Permalink
Browse files

GameScript::AreaCheckObject: don't crash if the area is current null

  • Loading branch information...
lynxlynxlynx committed May 26, 2013
1 parent cd1f81f commit 32f9f8bb73045c5eb38944c3262cbabcfe7c24a8
Showing with 5 additions and 1 deletion.
  1. +5 −1 gemrb/core/GameScript/Triggers.cpp
@@ -2716,7 +2716,11 @@ int GameScript::AreaCheckObject(Scriptable* Sender, Trigger* parameters)
if (!tar) {
return 0;
}
- if (!strnicmp(tar->GetCurrentArea()->GetScriptName(), parameters->string0Parameter, 8)) {
+ Map *map = tar->GetCurrentArea();
+ if (!map) {
+ return 0;
+ }
+ if (!strnicmp(map->GetScriptName(), parameters->string0Parameter, 8)) {
return 1;
}
return 0;

0 comments on commit 32f9f8b

Please sign in to comment.