From: Laszlo T. <ave...@us...> - 2005-06-28 18:16:18
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32410/plugins/Core Modified Files: Actions.cpp ActorBlock.cpp GSUtils.cpp GSUtils.h GameControl.cpp GameScript.cpp GameScript.h Map.cpp SaveGameIterator.h TileMap.h Triggers.cpp Log Message: fixed ? actionoverride door/container highlights when alt is kept pressed (instead of until pressed again) Index: GSUtils.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/GSUtils.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GSUtils.h 26 Jun 2005 19:21:32 -0000 1.4 --- GSUtils.h 28 Jun 2005 18:16:00 -0000 1.5 *************** *** 59,65 **** --- 59,67 ---- SrcVector *LoadSrc(const ieResRef resname); Action *ParamCopy(Action *parameters); + Action *ParamCopyNoOverride(Action *parameters); void SetVariable(Scriptable* Sender, const char* VarName, const char* Context, ieDword value); void SetVariable(Scriptable* Sender, const char* VarName, ieDword value); //these are used from other plugins + GEM_EXPORT void MoveBetweenAreasCore(Actor* actor, const char *area, Point &position, int face, bool adjust); GEM_EXPORT ieDword CheckVariable(Scriptable* Sender, const char* VarName); GEM_EXPORT ieDword CheckVariable(Scriptable* Sender, const char* VarName, const char* Context); Index: SaveGameIterator.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/SaveGameIterator.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** SaveGameIterator.h 22 Jun 2005 15:55:26 -0000 1.18 --- SaveGameIterator.h 28 Jun 2005 18:16:08 -0000 1.19 *************** *** 40,44 **** #endif ! #define SAVEGAME_DIRECTORY_MATCHER "%d - %[A-Za-z0-9- ]" class GEM_EXPORT SaveGame { --- 40,44 ---- #endif ! #define SAVEGAME_DIRECTORY_MATCHER "%d - %[A-Za-z0-9- _]" class GEM_EXPORT SaveGame { Index: GameScript.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/GameScript.cpp,v retrieving revision 1.300 retrieving revision 1.301 diff -C2 -d -r1.300 -r1.301 *** GameScript.cpp 26 Jun 2005 19:21:32 -0000 1.300 --- GameScript.cpp 28 Jun 2005 18:16:00 -0000 1.301 *************** *** 161,165 **** {"isgabber", GameScript::IsGabber, 0}, {"islocked", GameScript::IsLocked, 0}, ! {"isextendednight", GameScript::IsExtendedNight, 0}, {"isplayernumber", GameScript::IsPlayerNumber, 0}, {"isrotation", GameScript::IsRotation, 0}, --- 161,166 ---- {"isgabber", GameScript::IsGabber, 0}, {"islocked", GameScript::IsLocked, 0}, ! {"isextendednight", GameScript::IsExtendedNight, 0}, ! {"isoverme", GameScript::Entered, 0}, // same as harmlessentered {"isplayernumber", GameScript::IsPlayerNumber, 0}, {"isrotation", GameScript::IsRotation, 0}, *************** *** 293,297 **** //Make this an ordered list, so we could use bsearch! static ActionLink actionnames[] = { ! {"actionoverride",NULL, 0}, {"activate", GameScript::Activate, 0}, {"addareaflag", GameScript::AddAreaFlag, 0}, --- 294,298 ---- //Make this an ordered list, so we could use bsearch! static ActionLink actionnames[] = { ! {"actionoverride",NULL, AF_INVALID}, //will this function ever be reached {"activate", GameScript::Activate, 0}, {"addareaflag", GameScript::AddAreaFlag, 0}, *************** *** 1198,1201 **** --- 1199,1206 ---- oB->objectFields[i + ObjectFieldsCount] = ParseInt( line ); } + //let the object realize it has no future (in case of null objects) + if (oB->ReadyToDie()) { + oB = NULL; + } return oB; } *************** *** 2541,2548 **** break; case AF_NONE: ! if (Sender->CutSceneId) Sender->CutSceneId->AddAction( aC ); ! else ! Sender->AddAction( aC ); break; case AF_CONTINUE: --- 2546,2557 ---- break; case AF_NONE: ! if (Sender->CutSceneId) { Sender->CutSceneId->AddAction( aC ); ! //AddAction( Sender->CutSceneId, aC ); ! } ! else { ! //Sender->AddAction( aC ); ! AddAction( Sender, aC ); ! } break; case AF_CONTINUE: *************** *** 2555,2560 **** } ! void GameScript::ExecuteAction(Scriptable* Sender, Action* aC) { if (InDebug&ID_ACTIONS) { printMessage("GameScript"," ",YELLOW); --- 2564,2601 ---- } ! //resolving actionoverride in delayed actions ! void GameScript::AddAction(Scriptable* Sender, Action* aC) { + if (aC->objects[0]) { //this is an actionoverride + Sender = GetActorFromObject( Sender, aC->objects[0]); + if (Sender) { + Sender->AddAction(ParamCopyNoOverride(aC) ); + } else { + printMessage("GameScript","Actionoverride failed for object: \n",LIGHT_RED); + aC->objects[0]->Dump(); + } + return; + } + Sender->AddAction(aC); + } + + void GameScript::ExecuteAction(Scriptable* Sender, Action* aC) + { + if (aC->objects[0]) { + Scriptable *scr = GetActorFromObject(Sender, aC->objects[0]); + if (scr) { + if (InDebug&ID_ACTIONS) { + printMessage("GameScript"," ",YELLOW); + printf("Sender: %s-->override: %s\n",Sender->GetScriptName(), scr->GetScriptName() ); + } + scr->AddAction(ParamCopyNoOverride(Sender->CurrentAction)); + } else { + printMessage("GameScript","Actionoverride failed for object: \n",LIGHT_RED); + aC->objects[0]->Dump(); + } + Sender->CurrentAction=NULL; + aC->Release(); + return; + } if (InDebug&ID_ACTIONS) { printMessage("GameScript"," ",YELLOW); *************** *** 2563,2592 **** ActionFunction func = actions[aC->actionID]; if (func) { ! Scriptable* scr = GetActorFromObject( Sender, aC->objects[0]); ! if (scr && scr!=Sender) { ! //this is an Action* Override ! scr->AddAction( Sender->CurrentAction ); ! Sender->CurrentAction = NULL; ! //maybe we should always release here??? ! if (!(actionflags[aC->actionID] & AF_INSTANT) ) { ! aC->Release(); ! } ! return; ! } ! else { ! if (InDebug&ID_ACTIONS) { ! printMessage("GameScript"," ",YELLOW); ! printf( "Executing action code: %d %s\n", aC->actionID , actionsTable->GetValue(aC->actionID) ); ! } ! //turning off interruptable flag ! //uninterruptable actions will set it back ! if (Sender->Type==ST_ACTOR) { ! Sender->Active|=SCR_ACTIVE; ! ((Actor *)Sender)->InternalFlags&=~IF_NOINT; ! } ! func( Sender, aC ); ! } ! } ! else { actions[aC->actionID] = NoActionAtAll; printMessage("GameScript", " ", YELLOW); --- 2604,2615 ---- ActionFunction func = actions[aC->actionID]; if (func) { ! //turning off interruptable flag ! //uninterruptable actions will set it back ! if (Sender->Type==ST_ACTOR) { ! Sender->Active|=SCR_ACTIVE; ! ((Actor *)Sender)->InternalFlags&=~IF_NOINT; ! } ! func( Sender, aC ); ! } else { actions[aC->actionID] = NoActionAtAll; printMessage("GameScript", " ", YELLOW); *************** *** 2645,2646 **** --- 2668,2687 ---- return GenerateActionCore( src, str, i, autoFree); } + + bool Object::ReadyToDie() + { + if (objectName[0]!=0) { + return false; + } + if (objectFilters[0]) { + return false; + } + for (int i=0;i<ObjectFieldsCount;i++) { + if (objectFields[i]) { + return false; + } + } + //commit suicide + Release(); + return true; + } Index: GSUtils.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/GSUtils.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** GSUtils.cpp 26 Jun 2005 19:21:32 -0000 1.8 --- GSUtils.cpp 28 Jun 2005 18:16:00 -0000 1.9 *************** *** 446,449 **** --- 446,452 ---- Map *map = src->GetCurrentArea(); tar->SetPosition(map, src->Pos, 1); + tar->SetOrientation(src->GetOrientation(), 0 ); + map->AddActor( tar ); + src->InternalFlags|=IF_CLEANUP; if (effect) { *************** *** 667,670 **** --- 670,702 ---- } + void MoveBetweenAreasCore(Actor* actor, const char *area, Point &position, int face, bool adjust) + { + printMessage("GameScript", " ", WHITE); + printf("MoveBetweenAreas: %s to %s [%d.%d] face: %d\n", actor->GetName(0), area,position.x,position.y, face); + Map* map2; + Game* game = core->GetGame(); + if (area[0]) { //do we need to switch area? + Map* map1 = actor->GetCurrentArea(); + //we have to change the pathfinder + //to the target area if adjust==true + map2 = game->GetMap(area, false); + if ( map1!=map2 ) { + if (map1) { + map1->RemoveActor( actor ); + } + map2->AddActor( actor ); + } + } + else { + map2=actor->GetCurrentArea(); + } + actor->SetPosition(map2, position, adjust); + if (face !=-1) { + actor->SetOrientation( face,0 ); + } + GameControl *gc=core->GetGameControl(); + gc->SetScreenFlags(SF_CENTERONACTOR,BM_OR); + } + //It is possible to attack CONTAINERS/DOORS as well!!! void AttackCore(Scriptable *Sender, Scriptable *target, Action *parameters, int flags) *************** *** 701,705 **** bool GameScript::MatchActor(Scriptable *Sender, Actor* actor, Object* oC) { ! if (!actor) { return false; } --- 733,737 ---- bool GameScript::MatchActor(Scriptable *Sender, Actor* actor, Object* oC) { ! if (!actor || !oC) { return false; } *************** *** 1098,1101 **** --- 1130,1149 ---- } + Action *ParamCopyNoOverride(Action *parameters) + { + Action *newAction = new Action(true); + newAction->actionID = parameters->actionID; + newAction->int0Parameter = parameters->int0Parameter; + newAction->int1Parameter = parameters->int1Parameter; + newAction->int2Parameter = parameters->int2Parameter; + newAction->pointParameter = parameters->pointParameter; + MEMCPY( newAction->string0Parameter, parameters->string0Parameter ); + MEMCPY( newAction->string1Parameter, parameters->string1Parameter ); + newAction->objects[0]= NULL; + newAction->objects[1]= ObjectCopy( parameters->objects[1] ); + newAction->objects[2]= ObjectCopy( parameters->objects[2] ); + return newAction; + } + Trigger *GenerateTriggerCore(const char *src, const char *str, int trIndex, int negate) { Index: TileMap.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/TileMap.h,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** TileMap.h 17 Jun 2005 19:33:06 -0000 1.35 --- TileMap.h 28 Jun 2005 18:16:08 -0000 1.36 *************** *** 61,66 **** unsigned int GetDoorCount() { return doors.size(); } ! /* type is an optional filter for container type*/ ! void AddContainer(Container *c); Container* GetContainer(Point &position, int type=-1); Container* GetContainer(const char* Name); --- 61,66 ---- unsigned int GetDoorCount() { return doors.size(); } ! /* type is an optional filter for container type*/ ! void AddContainer(Container *c); Container* GetContainer(Point &position, int type=-1); Container* GetContainer(const char* Name); Index: GameScript.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/GameScript.h,v retrieving revision 1.199 retrieving revision 1.200 diff -C2 -d -r1.199 -r1.200 *** GameScript.h 26 Jun 2005 19:21:33 -0000 1.199 --- GameScript.h 28 Jun 2005 18:16:01 -0000 1.200 *************** *** 155,158 **** --- 155,159 ---- delete this; } + bool ReadyToDie(); }; *************** *** 599,602 **** --- 600,604 ---- //#define AF_RESTRICTED_LEVEL2 32 //maybe we could use 2 bits for this??? #define AF_SCRIPTLEVEL 64 //this hack will transfer scriptlevel to int0parameter at runtime (changecurrentscript relies on it) + #define AF_INVALID 128 struct ActionLink { *************** *** 670,675 **** static void ExecuteString(Scriptable* Sender, char* String); static int EvaluateString(Scriptable* Sender, char* String); static void ExecuteAction(Scriptable* Sender, Action* aC); - static void MoveBetweenAreasCore(Actor* actor, const char *area, Point &position, int face, bool adjust); public: //Script Functions static int ID_Alignment(Actor *actor, int parameter); --- 672,677 ---- static void ExecuteString(Scriptable* Sender, char* String); static int EvaluateString(Scriptable* Sender, char* String); + static void AddAction(Scriptable* Sender, Action* aC); static void ExecuteAction(Scriptable* Sender, Action* aC); public: //Script Functions static int ID_Alignment(Actor *actor, int parameter); Index: Map.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Map.cpp,v retrieving revision 1.172 retrieving revision 1.173 diff -C2 -d -r1.172 -r1.173 *** Map.cpp 19 Jun 2005 22:59:34 -0000 1.172 --- Map.cpp 28 Jun 2005 18:16:01 -0000 1.173 *************** *** 1,2 **** --- 1,3 ---- + /* GemRB - Infinity Engine Emulator * Copyright (C) 2003-2004 The GemRB Project *************** *** 472,476 **** while (q--) { Actor* actor = queue[0][q]; ! if (ip->Type == ST_PROXIMITY) { if (ip->outline->PointIn( actor->Pos )) { ip->Entered(actor); --- 473,477 ---- while (q--) { Actor* actor = queue[0][q]; ! if ((ip->Type == ST_PROXIMITY) && !(ip->Flags&TRAP_DEACTIVATED) ) { if (ip->outline->PointIn( actor->Pos )) { ip->Entered(actor); *************** *** 562,566 **** //maybe we should divide only by 128, so brightening is possible too? In that case use 128,128,128 here Color tint = {255,255,255,0}; ! if (!(a->Flags&A_ANI_NO_SHADOW)) { tint = LightMap->GetPixel( a->Pos.x / 16, a->Pos.y / 12); } --- 563,567 ---- //maybe we should divide only by 128, so brightening is possible too? In that case use 128,128,128 here Color tint = {255,255,255,0}; ! if ((a->Flags&A_ANI_NO_SHADOW)) { tint = LightMap->GetPixel( a->Pos.x / 16, a->Pos.y / 12); } *************** *** 705,709 **** continue; Color tint = {255,255,255,0}; ! if (!(a->Flags&A_ANI_NO_SHADOW)) { tint = LightMap->GetPixel( a->Pos.x / 16, a->Pos.y / 12); } --- 706,710 ---- continue; Color tint = {255,255,255,0}; ! if ((a->Flags&A_ANI_NO_SHADOW)) { tint = LightMap->GetPixel( a->Pos.x / 16, a->Pos.y / 12); } Index: Triggers.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Triggers.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Triggers.cpp 26 Jun 2005 13:57:52 -0000 1.6 --- Triggers.cpp 28 Jun 2005 18:16:08 -0000 1.7 *************** *** 1086,1090 **** int GameScript::Clicked(Scriptable* Sender, Trigger* parameters) { ! if (parameters->objectParameter->objectFields[0] == 0) { if (Sender->LastTrigger) { Sender->AddTrigger (&Sender->LastTrigger); --- 1086,1093 ---- int GameScript::Clicked(Scriptable* Sender, Trigger* parameters) { ! //now objects suicide themselves if they are empty objects ! //so checking an empty object is easier ! //if (parameters->objectParameter->objectFields[0] == 0) { ! if (parameters->objectParameter == NULL) { if (Sender->LastTrigger) { Sender->AddTrigger (&Sender->LastTrigger); *************** *** 1106,1110 **** return 0; } ! if (parameters->objectParameter->objectFields[0] == 0) { if (Sender->LastEntered) { Sender->AddTrigger (&Sender->LastEntered); --- 1109,1113 ---- return 0; } ! if (parameters->objectParameter == NULL) { if (Sender->LastEntered) { Sender->AddTrigger (&Sender->LastEntered); *************** *** 1427,1439 **** } static int SeeCore(Scriptable* Sender, Trigger* parameters, int justlos) { - if (Sender->Type != ST_ACTOR) { - return 0; - } - Actor* snd = ( Actor* ) Sender; Scriptable* tar = GetActorFromObject( Sender, parameters->objectParameter ); /* don't set LastSeen if this isn't an actor */ ! if (!tar || tar->Type !=ST_ACTOR) { return 0; } --- 1430,1440 ---- } + //non actors can see too (reducing function to LOS) + //non actors can be seen too (reducing function to LOS) static int SeeCore(Scriptable* Sender, Trigger* parameters, int justlos) { Scriptable* tar = GetActorFromObject( Sender, parameters->objectParameter ); /* don't set LastSeen if this isn't an actor */ ! if (!tar) { return 0; } *************** *** 1443,1448 **** return 1; } ! //additional checks for invisibility? ! snd->LastSeen = (Actor *) tar; return 1; } --- 1444,1452 ---- return 1; } ! if (Sender->Type==ST_ACTOR && tar->Type==ST_ACTOR) { ! Actor* snd = ( Actor* ) Sender; ! //additional checks for invisibility? ! snd->LastSeen = (Actor *) tar; ! } return 1; } *************** *** 1484,1487 **** --- 1488,1495 ---- int GameScript::NumCreatureVsParty(Scriptable* Sender, Trigger* parameters) { + //creating object on the spot + if (!parameters->objectParameter) { + parameters->objectParameter = new Object(); + } parameters->objectParameter->objectFields[0]=EA_EVILCUTOFF; int value = GetObjectCount(Sender, parameters->objectParameter); *************** *** 1491,1494 **** --- 1499,1505 ---- int GameScript::NumCreatureVsPartyGT(Scriptable* Sender, Trigger* parameters) { + if (!parameters->objectParameter) { + parameters->objectParameter = new Object(); + } parameters->objectParameter->objectFields[0]=EA_EVILCUTOFF; int value = GetObjectCount(Sender, parameters->objectParameter); *************** *** 1498,1501 **** --- 1509,1515 ---- int GameScript::NumCreatureVsPartyLT(Scriptable* Sender, Trigger* parameters) { + if (!parameters->objectParameter) { + parameters->objectParameter = new Object(); + } parameters->objectParameter->objectFields[0]=EA_EVILCUTOFF; int value = GetObjectCount(Sender, parameters->objectParameter); *************** *** 1590,1594 **** Scriptable* tar = GetActorFromObject( Sender, parameters->objectParameter ); if (!tar) { ! printf("[GameScript]: couldn't find door/container:%s\n",parameters->objectParameter->objectName); return 0; } --- 1604,1609 ---- Scriptable* tar = GetActorFromObject( Sender, parameters->objectParameter ); if (!tar) { ! printMessage("[GameScript]"," ",LIGHT_RED); ! printf("couldn't find door/container:%s\n", parameters->objectParameter? parameters->objectParameter->objectName:"<NULL>"); return 0; } *************** *** 1606,1610 **** default:; //to remove a warning } ! printf("[GameScript]: couldn't find door/container:%s\n",parameters->string0Parameter); return 0; } --- 1621,1626 ---- default:; //to remove a warning } ! printMessage("[GameScript]"," ",LIGHT_RED); ! printf("Not a door/container:%s\n", tar->GetScriptName()); return 0; } *************** *** 1614,1618 **** Scriptable* tar = GetActorFromObject( Sender, parameters->objectParameter ); if (!tar) { ! printf("[GameScript]: couldn't find door/container:%s\n",parameters->objectParameter->objectName); return 0; } --- 1630,1635 ---- Scriptable* tar = GetActorFromObject( Sender, parameters->objectParameter ); if (!tar) { ! printMessage("[GameScript]"," ",LIGHT_RED); ! printf("couldn't find door/container:%s\n", parameters->objectParameter? parameters->objectParameter->objectName:"<NULL>"); return 0; } *************** *** 1630,1634 **** default:; //to remove a warning } ! printf("[GameScript]: couldn't find door/container:%s\n",parameters->string0Parameter); return 0; } --- 1647,1652 ---- default:; //to remove a warning } ! printMessage("[GameScript]"," ",LIGHT_RED); ! printf("Not a door/container:%s\n", tar->GetScriptName()); return 0; } Index: GameControl.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/GameControl.cpp,v retrieving revision 1.239 retrieving revision 1.240 diff -C2 -d -r1.239 -r1.240 *** GameControl.cpp 26 Jun 2005 19:21:32 -0000 1.239 --- GameControl.cpp 28 Jun 2005 18:16:00 -0000 1.240 *************** *** 29,32 **** --- 29,33 ---- #include "../../includes/strrefs.h" #include "Effect.h" + #include "GSUtils.h" #define DEBUG_SHOW_INFOPOINTS 0x01 *************** *** 43,46 **** --- 44,50 ---- 0xff, 0x00, 0x00, 0xff }; + static Color magenta = { + 0xff, 0x00, 0xff, 0xff + }; static Color green = { 0x00, 0xff, 0x00, 0xff *************** *** 244,247 **** --- 248,264 ---- (d = area->TMap->GetDoor( idx )); idx++) { + if (d->TrapFlags) { + d->outlineColor = red; + } else { + if (d->Flags &DOOR_SECRET) { + if (d->Flags & DOOR_FOUND) { + d->outlineColor = magenta; + } else { + //secret door is invisible + continue; + } + } + d->outlineColor = cyan; + } d->DrawOutline(); } *************** *** 252,256 **** Container* c; - DialogueFlags |= DF_FREEZE_SCRIPTS; //there is a real assignment in the loop! for (unsigned int idx = 0; --- 269,272 ---- *************** *** 258,265 **** idx++) { if (c->TrapDetected && c->Trapped) { ! video->DrawPolyline( c->outline, red, true ); } else { ! video->DrawPolyline( c->outline, cyan, true ); } } } --- 274,282 ---- idx++) { if (c->TrapDetected && c->Trapped) { ! c->outlineColor = red; } else { ! c->outlineColor = cyan; } + c->DrawOutline(); } } *************** *** 275,293 **** } ! // Show traps and containers ! if (DebugFlags & (DEBUG_SHOW_INFOPOINTS | DEBUG_SHOW_CONTAINERS)) { //draw infopoints with blue overlay InfoPoint* i; //there is a real assignment in the loop! for (unsigned int idx = 0; (i = area->TMap->GetInfoPoint( idx )); idx++) { ! if (i->VisibleTrap( DebugFlags & DEBUG_SHOW_INFOPOINTS ) ) { ! video->DrawPolyline( i->outline, red, true ); ! } else if (DebugFlags & DEBUG_SHOW_INFOPOINTS) { ! video->DrawPolyline( i->outline, blue, true ); } } ! } else if (overInfoPoint) { ! if (overInfoPoint->VisibleTrap(0) ) { ! video->DrawPolyline( overInfoPoint->outline, red, true ); } } --- 292,316 ---- } ! // Show traps ! if (DebugFlags & DEBUG_SHOW_INFOPOINTS) { //draw infopoints with blue overlay InfoPoint* i; //there is a real assignment in the loop! for (unsigned int idx = 0; (i = area->TMap->GetInfoPoint( idx )); idx++) { ! if (i->VisibleTrap( 1 ) ) { ! i->outlineColor = red; //traps ! i->DrawOutline(); ! } else { ! i->outlineColor = blue; //infopoints ! i->DrawOutline(); } } ! } else { ! InfoPoint* i; ! for (unsigned int idx = 0; (i = area->TMap->GetInfoPoint( idx )); idx++) { ! if (i->VisibleTrap( 0 ) ) { ! i->outlineColor = red; //traps ! i->DrawOutline(); ! } } } *************** *** 400,403 **** --- 423,429 ---- switch (Key) { + case GEM_ALT: + DebugFlags &= ~DEBUG_SHOW_CONTAINERS; + break; case '=': SelectActor(-1); *************** *** 508,512 **** Point p(lastMouseX, lastMouseY); core->GetVideoDriver()->ConvertToGame( p.x, p.y ); ! GameScript::MoveBetweenAreasCore(actor, core->GetGame()->CurrentArea, p, -1, true); printf( "Teleported to %d, %d\n", p.x, p.y ); } --- 534,538 ---- Point p(lastMouseX, lastMouseY); core->GetVideoDriver()->ConvertToGame( p.x, p.y ); ! MoveBetweenAreasCore(actor, core->GetGame()->CurrentArea, p, -1, true); printf( "Teleported to %d, %d\n", p.x, p.y ); } *************** *** 1007,1012 **** break; case GEM_ALT: ! DebugFlags ^= DEBUG_SHOW_CONTAINERS; ! printf( "ALT pressed\n" ); break; case GEM_TAB: --- 1033,1037 ---- break; case GEM_ALT: ! DebugFlags |= DEBUG_SHOW_CONTAINERS; break; case GEM_TAB: Index: ActorBlock.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/ActorBlock.cpp,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** ActorBlock.cpp 22 Jun 2005 15:55:24 -0000 1.98 --- ActorBlock.cpp 28 Jun 2005 18:15:59 -0000 1.99 *************** *** 154,158 **** { if (!aC) { ! printf( "[IEScript]: NULL action encountered for %s!\n",scriptName ); return; } --- 154,158 ---- { if (!aC) { ! printf( "[GameScript]: NULL action encountered for %s!\n",scriptName ); return; } *************** *** 165,169 **** { if (!aC) { ! printf( "[IEScript]: NULL action encountered for %s!\n",scriptName ); return; } --- 165,169 ---- { if (!aC) { ! printf( "[GameScript]: NULL action encountered for %s!\n",scriptName ); return; } Index: Actions.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Actions.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Actions.cpp 26 Jun 2005 19:21:32 -0000 1.11 --- Actions.cpp 28 Jun 2005 18:15:59 -0000 1.12 *************** *** 532,541 **** void GameScript::CutSceneID(Scriptable* Sender, Action* parameters) { ! if (parameters->objects[1]->objectName[0]) { ! Map *map = Sender->GetCurrentArea(); ! Sender->CutSceneId = map->GetActor( parameters->objects[1]->objectName ); ! } else { ! Sender->CutSceneId = GetActorFromObject( Sender, parameters->objects[1] ); ! } if (InDebug&ID_CUTSCENE) { if (!Sender->CutSceneId) { --- 532,536 ---- void GameScript::CutSceneID(Scriptable* Sender, Action* parameters) { ! Sender->CutSceneId = GetActorFromObject( Sender, parameters->objects[1]); if (InDebug&ID_CUTSCENE) { if (!Sender->CutSceneId) { *************** *** 1649,1680 **** } - void GameScript::MoveBetweenAreasCore(Actor* actor, const char *area, Point &position, int face, bool adjust) - { - printf("MoveBetweenAreas: %s to %s [%d.%d] face: %d\n", actor->GetName(0), area,position.x,position.y, face); - Map* map2; - Game* game = core->GetGame(); - if (area[0]) { //do we need to switch area? - Map* map1 = actor->GetCurrentArea(); - //we have to change the pathfinder - //to the target area if adjust==true - map2 = game->GetMap(area, false); - if ( map1!=map2 ) { - if (map1) { - map1->RemoveActor( actor ); - } - map2->AddActor( actor ); - } - } - else { - map2=actor->GetCurrentArea(); - } - actor->SetPosition(map2, position, adjust); - if (face !=-1) { - actor->SetOrientation( face,0 ); - } - GameControl *gc=core->GetGameControl(); - gc->SetScreenFlags(SF_CENTERONACTOR,BM_OR); - } - void GameScript::MoveBetweenAreas(Scriptable* Sender, Action* parameters) { --- 1644,1647 ---- |