From: Laszlo T. <ave...@us...> - 2012-03-24 21:06:38
|
gemrb: Infinity Engine emulator The branch master has been updated via 7c7cffa87f55f2bef963027205a13cda9acc0f67 (commit) Summary of changes: gemrb/plugins/FXOpcodes/FXOpcodes.cpp | 42 +++++++++++++++++++++++++-------- 1 files changed, 32 insertions(+), 10 deletions(-) from e6a112b2f3b9585897ac6f3e668a493a8814a8d0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=7c7cffa87f55f2bef963027205a13cda9acc0f67 commit 7c7cffa87f55f2bef963027205a13cda9acc0f67 Author: Avenger <ave...@so...> Date: Sat Mar 24 22:05:41 2012 +0100 move to area effect (instead of immediate moving, make actor global and wait till the current area is the target area) diff --git a/gemrb/plugins/FXOpcodes/FXOpcodes.cpp b/gemrb/plugins/FXOpcodes/FXOpcodes.cpp index 034520b..4c1a60b 100644 --- a/gemrb/plugins/FXOpcodes/FXOpcodes.cpp +++ b/gemrb/plugins/FXOpcodes/FXOpcodes.cpp @@ -4847,17 +4847,39 @@ int fx_dontjump_modifier (Scriptable* /*Owner*/, Actor* target, Effect* fx) int fx_move_to_area (Scriptable* /*Owner*/, Actor* target, Effect* fx) { if (0) print( "fx_move_to_area (%2d) %s", fx->Opcode, fx->Resource ); - //delay effect until the target has finished the previous move to an area - //hopefully this fixes an evil bug - Map *map = target->GetCurrentArea(); - if (!map || !map->HasActor(target)) { - //stay around for the next evaluation - return FX_APPLIED; + + Game *game = core->GetGame(); + //remove actor from current map, and set destination map + if (fx->FirstApply) { + //if current area is different from target area + if (strnicmp(game->CurrentArea, fx->Resource, 8) ) { + //make global + game->AddNPC( target ); + //remove from current area + Map *map = target->GetCurrentArea(); + if (map) { + map->RemoveActor( target ); + } + //set the destination area + strnuprcpy(target->Area, fx->Resource, 8); + return FX_APPLIED; + } } - Point p(fx->PosX,fx->PosY); - MoveBetweenAreasCore(target, fx->Resource, p, fx->Parameter2, true); - //this effect doesn't stick - return FX_NOT_APPLIED; + + if (!strnicmp(game->CurrentArea, fx->Resource, 8) ) { + //UnMakeGlobal + int slot = core->GetGame()->InStore( target ); + if (slot >= 0) { + game->DelNPC( slot ); + } + //move to area + Point p(fx->PosX,fx->PosY); + MoveBetweenAreasCore(target, fx->Resource, p, fx->Parameter2, true); + //remove the effect now + return FX_NOT_APPLIED; + } + //stick around, waiting for the time + return FX_APPLIED; } // 0xbb Variable:StoreLocalVariable ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |