Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EnterHeroName on bad actor? Report error instead of crash #1719

Merged
merged 1 commit into from May 6, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

EnterHeroName on bad actor? Report error instead of crash

  • Loading branch information...
fmatthew5876 committed Mar 22, 2019
commit 4b53692169330f0c96f65fb70f0e63d9781e50e9
@@ -560,15 +560,14 @@ bool Game_Interpreter_Map::CommandEnterHeroName(RPG::EventCommand const& com) {
Game_Temp::hero_name_id = com.parameters[0];
Game_Temp::hero_name_charset = com.parameters[1];

if (com.parameters[2] != 0) {
Game_Actor *actor = Game_Actors::GetActor(Game_Temp::hero_name_id);

if (!actor) {
Output::Warning("EnterHeroName: Invalid actor ID %d", Game_Temp::hero_name_id);
Game_Temp::hero_name.clear();
} else {
Game_Temp::hero_name = actor->GetName();
}
Game_Actor *actor = Game_Actors::GetActor(Game_Temp::hero_name_id);

if (!actor) {
Output::Error("EnterHeroName: Invalid actor ID %d", Game_Temp::hero_name_id);
}

if (com.parameters[2]) {
Game_Temp::hero_name = actor->GetName();
} else {
Game_Temp::hero_name.clear();
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.