Skip to content

Commit

Permalink
AiObjectContext: properly load values that are empty strings (#9)
Browse files Browse the repository at this point in the history
* AiObjectContext: properly load values that are empty strings

* Update AiObjectContext.cpp

---------

Co-authored-by: Viger <[email protected]>
Co-authored-by: David Parra <[email protected]>
  • Loading branch information
3 people authored May 24, 2024
1 parent f89cd80 commit c223617
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions playerbot/strategy/AiObjectContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ void AiObjectContext::Load(std::list<std::string> data)
{
std::string row = *i;
std::vector<std::string> parts = split(row, '>');
if (parts.size() != 2) continue;
if (parts.empty() || parts.size() > 2) continue;

std::string name = parts[0];
std::string text = parts[1];
std::string text = (parts.size() == 2) ? parts[1] : "";

UntypedValue* value = GetUntypedValue(name);
if (!value) continue;
Expand Down

0 comments on commit c223617

Please sign in to comment.