diff --git a/reaction/game/g_cmds.c b/reaction/game/g_cmds.c index 43d917d3..b5a9ef44 100644 --- a/reaction/game/g_cmds.c +++ b/reaction/game/g_cmds.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.189 2003/09/16 23:25:32 makro +// trigger_multiple - new spawnflag, 3 new keys +// // Revision 1.188 2003/04/26 22:33:06 jbravo // Wratted all calls to G_FreeEnt() to avoid crashing and provide debugging // @@ -2471,6 +2474,8 @@ void Cmd_OpenDoor(gentity_t * ent) if (ent->client->ps.stats[STAT_HEALTH] <= 0 || ent->client->ps.pm_type == PM_SPECTATOR) return; + //Makro - doesn't look right to me. Doing it one single time should be enough + /* while ((door = findradius(door, ent->r.currentOrigin, 100)) != NULL) { if (Q_stricmp(door->classname, "func_door_rotating") == 0) { ent->client->openDoor = qtrue; @@ -2480,6 +2485,9 @@ void Cmd_OpenDoor(gentity_t * ent) ent->client->openDoorTime = level.time; } } + */ + ent->client->openDoor = qtrue; + ent->client->openDoorTime = level.time; } /* Hawkins. Reaction weapon command */ diff --git a/reaction/game/g_local.h b/reaction/game/g_local.h index 197cf087..b8a17162 100644 --- a/reaction/game/g_local.h +++ b/reaction/game/g_local.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.147 2003/09/16 23:25:32 makro +// trigger_multiple - new spawnflag, 3 new keys +// // Revision 1.146 2003/09/08 19:19:19 makro // New code for respawning entities in TP // @@ -1061,6 +1064,7 @@ void SanitizeString(char *in, char *out); //Makro - added gentity_t *G_Find2(gentity_t * from, int fieldofs, const char *match, int fieldofs2, const char *match2); gentity_t *G_PickTarget(char *targetname); +void G_UseEntities(gentity_t * ent, char *target, gentity_t * activator); void G_UseTargets(gentity_t * ent, gentity_t * activator); void G_SetMovedir(vec3_t angles, vec3_t movedir); diff --git a/reaction/game/g_mover.c b/reaction/game/g_mover.c index 2a05be67..56f3a52a 100644 --- a/reaction/game/g_mover.c +++ b/reaction/game/g_mover.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.66 2003/09/16 23:25:32 makro +// trigger_multiple - new spawnflag, 3 new keys +// // Revision 1.65 2003/09/08 21:43:36 makro // Doors don't reset by default in TP // @@ -167,8 +170,6 @@ #include "g_local.h" void InitRotator(gentity_t * ent); -//Makro - added -void G_UseEntities(gentity_t * ent, char *target, gentity_t * activator); /* =============================================================================== diff --git a/reaction/game/g_trigger.c b/reaction/game/g_trigger.c index 759f076d..0ee876bc 100644 --- a/reaction/game/g_trigger.c +++ b/reaction/game/g_trigger.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.29 2003/09/16 23:25:32 makro +// trigger_multiple - new spawnflag, 3 new keys +// // Revision 1.28 2003/09/08 19:19:20 makro // New code for respawning entities in TP // @@ -93,6 +96,18 @@ void InitTrigger(gentity_t * self) self->r.svFlags = SVF_NOCLIENT; } +/*QUAKED trigger_multiple (.5 .5 .5) ? DOOR +"wait" : Seconds between triggerings, 0.5 default, -1 = one time only. +"random" wait variance, default is 0 +Variable sized repeatable trigger. Must be targeted at one or more entities. +so, the basic time between firing is a random time between +(wait - random) and (wait + random) +*/ + +#define SF_TRIGGER_MULTIPLE_RED 1 +#define SF_TRIGGER_MULTIPLE_BLUE 2 +#define SF_TRIGGER_MULTIPLE_DOOR 4 + // the wait time has passed, so set back up for another activation void multi_wait(gentity_t * ent) { @@ -110,21 +125,30 @@ void multi_trigger(gentity_t * ent, gentity_t * activator) } //Makro - inactive trigger ? if (ent->inactive) { + if (ent->soundInactive) + G_AddEvent(ent, EV_GENERAL_SOUND, ent->soundInactive); + if (ent->targetInactive) + G_UseEntities(ent, ent->targetInactive, activator); return; } + if (ent->spawnflags & SF_TRIGGER_MULTIPLE_DOOR) + if (!activator || !activator->client || !activator->client->openDoor) + return; //Makro - added check; Q3 crashed in archives when playing //with .dll's and shooting one of the barrels if (activator != NULL) { if (activator->client) { - if ((ent->spawnflags & 1) && activator->client->sess.sessionTeam != TEAM_RED) { + if ((ent->spawnflags & SF_TRIGGER_MULTIPLE_RED) && activator->client->sess.sessionTeam != TEAM_RED) { return; } - if ((ent->spawnflags & 2) && activator->client->sess.sessionTeam != TEAM_BLUE) { + if ((ent->spawnflags & SF_TRIGGER_MULTIPLE_BLUE) && activator->client->sess.sessionTeam != TEAM_BLUE) { return; } } } + if (ent->sound1to2) + G_AddEvent(ent, EV_GENERAL_SOUND, ent->sound1to2); G_UseTargets(ent, ent->activator); if (ent->wait > 0) { @@ -165,15 +189,10 @@ void Reset_Multi(gentity_t *ent) ent->nextthink = 0; } -/*QUAKED trigger_multiple (.5 .5 .5) ? -"wait" : Seconds between triggerings, 0.5 default, -1 = one time only. -"random" wait variance, default is 0 -Variable sized repeatable trigger. Must be targeted at one or more entities. -so, the basic time between firing is a random time between -(wait - random) and (wait + random) -*/ void SP_trigger_multiple(gentity_t * ent) { + char *s; + G_SpawnFloat("wait", "0.5", &ent->wait); G_SpawnFloat("random", "0", &ent->random); @@ -181,6 +200,14 @@ void SP_trigger_multiple(gentity_t * ent) ent->random = ent->wait - FRAMETIME; G_Printf("trigger_multiple has random >= wait\n"); } + //Makro - added + if (G_SpawnString("soundInactive", "", &s)) + ent->soundInactive = G_SoundIndex(s); + if (G_SpawnString("noise", "", &s)) + ent->sound1to2 = G_SoundIndex(s); + else if (G_SpawnString("sound", "", &s)) + ent->sound1to2 = G_SoundIndex(s); + ent->touch = Touch_Multi; ent->use = Use_Multi; diff --git a/reaction/game/game.plg b/reaction/game/game.plg index 08c64c76..750a7ed2 100644 --- a/reaction/game/game.plg +++ b/reaction/game/game.plg @@ -6,13 +6,13 @@ --------------------Configuration: game - Win32 Release--------------------

Command Lines

-Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP19D.tmp" with contents +Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP53.tmp" with contents [ /nologo /G6 /ML /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FR"c:\reactionoutput/" /Fp"c:\reactionoutput/game.pch" /YX /Fo"c:\reactionoutput/" /Fd"c:\reactionoutput/" /FD /c -"C:\Games\Quake3\rq3source\reaction\game\bg_pmove.c" +"C:\Games\Quake3\rq3source\reaction\game\g_trigger.c" ] -Creating command line "cl.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP19D.tmp" -Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP19E.tmp" with contents +Creating command line "cl.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP53.tmp" +Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP54.tmp" with contents [ kernel32.lib user32.lib winmm.lib /nologo /base:"0x20000000" /subsystem:windows /dll /incremental:no /pdb:"c:\reactionoutput/qagamex86.pdb" /map:"c:\reactionoutput/qagamex86.map" /machine:I386 /def:".\game.def" /out:"..\Release/qagamex86.dll" /implib:"c:\reactionoutput/qagamex86.lib" \reactionoutput\ai_chat.obj @@ -56,13 +56,13 @@ kernel32.lib user32.lib winmm.lib /nologo /base:"0x20000000" /subsystem:windows \reactionoutput\zcam.obj \reactionoutput\zcam_target.obj ] -Creating command line "link.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP19E.tmp" +Creating command line "link.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP54.tmp"

Output Window

Compiling... -bg_pmove.c +g_trigger.c Linking... Creating library c:\reactionoutput/qagamex86.lib and object c:\reactionoutput/qagamex86.exp -Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP1A2.tmp" with contents +Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP58.tmp" with contents [ /nologo /o"c:\reactionoutput/game.bsc" \reactionoutput\ai_chat.sbr @@ -105,7 +105,7 @@ Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP1A2.tmp" with conte \reactionoutput\rxn_game.sbr \reactionoutput\zcam.sbr \reactionoutput\zcam_target.sbr] -Creating command line "bscmake.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP1A2.tmp" +Creating command line "bscmake.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP58.tmp" Creating browse info file...

Output Window