fix: Remove instances of undefined behavior

This commit is contained in:
jadebenn
2024-11-21 02:05:29 -06:00
parent 53877a0bc3
commit 30d4076808
15 changed files with 71 additions and 65 deletions

View File

@@ -258,8 +258,8 @@ void DestroyableComponent::SetMaxHealth(float value, bool playAnim) {
if (!characterComponent) return;
AMFArrayValue args;
args.Insert("amount", std::to_string(difference));
args.Insert("type", "health");
args.Insert<std::string>("amount", std::to_string(difference));
args.Insert<std::string>("type", "health");
GameMessages::SendUIMessageServerToSingleClient(m_Parent, characterComponent->GetSystemAddress(), "MaxPlayerBarUpdate", args);
}
@@ -300,8 +300,8 @@ void DestroyableComponent::SetMaxArmor(float value, bool playAnim) {
if (!characterComponent) return;
AMFArrayValue args;
args.Insert("amount", std::to_string(value));
args.Insert("type", "armor");
args.Insert<std::string>("amount", std::to_string(value));
args.Insert<std::string>("type", "armor");
GameMessages::SendUIMessageServerToSingleClient(m_Parent, characterComponent->GetSystemAddress(), "MaxPlayerBarUpdate", args);
}
@@ -341,8 +341,8 @@ void DestroyableComponent::SetMaxImagination(float value, bool playAnim) {
if (!characterComponent) return;
AMFArrayValue args;
args.Insert("amount", std::to_string(difference));
args.Insert("type", "imagination");
args.Insert<std::string>("amount", std::to_string(difference));
args.Insert<std::string>("type", "imagination");
GameMessages::SendUIMessageServerToSingleClient(m_Parent, characterComponent->GetSystemAddress(), "MaxPlayerBarUpdate", args);
}

View File

@@ -36,7 +36,7 @@ void PropertyEntranceComponent::OnUse(Entity* entity) {
AMFArrayValue args;
args.Insert("state", "property_menu");
args.Insert<std::string>("state", "property_menu");
GameMessages::SendUIMessageServerToSingleClient(entity, entity->GetSystemAddress(), "pushGameState", args);
}

View File

@@ -98,7 +98,7 @@ namespace GMZeroCommands {
{
AMFArrayValue args;
args.Insert("state", "Story");
args.Insert<std::string>("state", "Story");
GameMessages::SendUIMessageServerToSingleClient(entity, entity->GetSystemAddress(), "pushGameState", args);
}
@@ -121,7 +121,7 @@ namespace GMZeroCommands {
{
AMFArrayValue args;
args.Insert("state", "Story");
args.Insert<std::string>("state", "Story");
GameMessages::SendUIMessageServerToSingleClient(entity, entity->GetSystemAddress(), "pushGameState", args);
}