From: Laszlo T. <ave...@us...> - 2005-04-03 21:00:17
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/GUIScript In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15928/GUIScript Modified Files: GUIScript.cpp Log Message: fixed area variable handling (unloaded area variables will be inaccessible) fixed object filters to calculate distance added Farthest, XthNearestEnemyOfType object filters Mirrored animations will be freed automatically (they don't come from animationfactory) Index: GUIScript.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp,v retrieving revision 1.297 retrieving revision 1.298 diff -C2 -d -r1.297 -r1.298 *** GUIScript.cpp 27 Mar 2005 13:27:01 -0000 1.297 --- GUIScript.cpp 3 Apr 2005 21:00:05 -0000 1.298 *************** *** 294,303 **** GameControl* gc = StartGameControl(); Actor* actor = game->GetPC (0); ! if (actor) { ! gc->ChangeMap(actor, true); ! } ! else { ! gc->SetCurrentArea(game->LoadMap(game->CurrentArea)); ! } Py_INCREF( Py_None ); --- 294,298 ---- GameControl* gc = StartGameControl(); Actor* actor = game->GetPC (0); ! gc->ChangeMap(actor, true); Py_INCREF( Py_None ); *************** *** 2568,2572 **** Scriptable *Sender = (Scriptable *) gc->GetLastActor(); if (!Sender) { ! Sender = (Scriptable *) core->GetGame()->GetCurrentMap(); } if (!Sender) { --- 2563,2567 ---- Scriptable *Sender = (Scriptable *) gc->GetLastActor(); if (!Sender) { ! Sender = (Scriptable *) core->GetGame()->GetCurrentArea(); } if (!Sender) { *************** *** 4025,4029 **** return AttributeError( GemRB_ExecuteString__doc ); } ! GameScript::ExecuteString( core->GetGame()->GetCurrentMap( ), String ); Py_INCREF( Py_None ); return Py_None; --- 4020,4024 ---- return AttributeError( GemRB_ExecuteString__doc ); } ! GameScript::ExecuteString( core->GetGame()->GetCurrentArea( ), String ); Py_INCREF( Py_None ); return Py_None; *************** *** 4041,4045 **** return AttributeError( GemRB_EvaluateString__doc ); } ! if (GameScript::EvaluateString( core->GetGame()->GetCurrentMap( ), String )) { printf( "%s returned True\n", String ); } else { --- 4036,4040 ---- return AttributeError( GemRB_EvaluateString__doc ); } ! if (GameScript::EvaluateString( core->GetGame()->GetCurrentArea( ), String )) { printf( "%s returned True\n", String ); } else { *************** *** 4095,4099 **** } Game *game = core->GetGame(); ! Map* map2 = game->GetMap(String); if (!map2) { return NULL; --- 4090,4094 ---- } Game *game = core->GetGame(); ! Map* map2 = game->GetMap(String, true); if (!map2) { return NULL; *************** *** 4105,4109 **** continue; } ! Map* map1 = game->GetMap(actor->Area); if (map1) { map1->RemoveActor( actor ); --- 4100,4104 ---- continue; } ! Map* map1 = actor->GetCurrentArea(); if (map1) { map1->RemoveActor( actor ); *************** *** 4671,4675 **** return RuntimeError( "No game loaded!" ); } ! Map *map = game->GetCurrentMap(); if (!map) { return RuntimeError( "No current area" ); --- 4666,4670 ---- return RuntimeError( "No game loaded!" ); } ! Map *map = game->GetCurrentArea(); if (!map) { return RuntimeError( "No current area" ); *************** *** 4711,4715 **** return RuntimeError( "Actor not found" ); } ! Map *map=game->GetCurrentMap(); if (!map) { return RuntimeError( "No current area" ); --- 4706,4710 ---- return RuntimeError( "Actor not found" ); } ! Map *map=game->GetCurrentArea(); if (!map) { return RuntimeError( "No current area" ); *************** *** 4736,4740 **** return RuntimeError( "No game loaded!" ); } ! Map *map=game->GetCurrentMap(); if (!map) { return RuntimeError( "No current area" ); --- 4731,4735 ---- return RuntimeError( "No game loaded!" ); } ! Map *map=game->GetCurrentArea(); if (!map) { return RuntimeError( "No current area" ); |