Skip to content

Commit

Permalink
UnrealURL: Correct teleport tag and options parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
LupertEverett authored and dpjudas committed Apr 23, 2024
1 parent 18fe92e commit 22fd19c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions SurrealEngine/UObject/UnrealURL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,18 @@ UnrealURL::UnrealURL(const std::string& urlString)
if (teleportTagPos != std::string::npos)
{
mapName = urlString.substr(0, teleportTagPos);
std::string allOptsString = urlString.substr(teleportTagPos + 1);

size_t optionsTagPos = urlString.find_first_of('?');
size_t optionsTagPos = allOptsString.find_first_of('?');

if (optionsTagPos != std::string::npos)
{
teleportTag = urlString.substr(teleportTagPos + 1, optionsTagPos - teleportTagPos + 1);
options = urlString.substr(optionsTagPos + 1);
teleportTag = allOptsString.substr(0, optionsTagPos);
options = allOptsString.substr(optionsTagPos + 1);
}
else
// No options mean that the string consists of only the map name and teleporter tag
teleportTag = urlString.substr(teleportTagPos + 1);
teleportTag = allOptsString;
}
else
{
Expand Down

0 comments on commit 22fd19c

Please sign in to comment.