Permalink
Browse files

TriggerActivation: properly decode the target object

So that stuff like "TriggerActivation(Myself, FALSE)" doesn't fail.
  • Loading branch information...
1 parent 4db74e3 commit 1e2677f7cf7bcf7e03c67a9e18bcd09215397471 @fizzet fizzet committed Jul 6, 2013
Showing with 3 additions and 5 deletions.
  1. +3 −5 gemrb/core/GameScript/Actions.cpp
View
8 gemrb/core/GameScript/Actions.cpp
@@ -459,12 +459,10 @@ void GameScript::SetTeamBit(Scriptable* Sender, Action* parameters)
void GameScript::TriggerActivation(Scriptable* Sender, Action* parameters)
{
- Scriptable* ip;
+ Scriptable* ip = Sender;
- if (!parameters->objects[1]) {
- ip=Sender;
- } else {
- ip = Sender->GetCurrentArea()->TMap->GetInfoPoint(parameters->objects[1]->objectName);
+ if (parameters->objects[1]) {
+ ip = GetActorFromObject(Sender, parameters->objects[1]);
}
if (!ip || (ip->Type!=ST_TRIGGER && ip->Type!=ST_TRAVEL && ip->Type!=ST_PROXIMITY)) {
Log(WARNING, "Actions", "Script error: No Trigger Named \"%s\"", parameters->objects[1]->objectName);

0 comments on commit 1e2677f

Please sign in to comment.