diff --git a/cl_dll/hud.h b/cl_dll/hud.h index bcb2dc08..167f6553 100644 --- a/cl_dll/hud.h +++ b/cl_dll/hud.h @@ -38,6 +38,8 @@ #define HUDELEM_ACTIVE 1 +extern int HUD_IsGame( const char *game ); + typedef struct { int x, y; diff --git a/cl_dll/quake/quake_baseentity.cpp b/cl_dll/quake/quake_baseentity.cpp index 3038977d..5013516d 100644 --- a/cl_dll/quake/quake_baseentity.cpp +++ b/cl_dll/quake/quake_baseentity.cpp @@ -33,7 +33,7 @@ const Vector g_vecZero = Vector( 0, 0, 0 ); int gmsgWeapPickup = 0; enginefuncs_t g_engfuncs; globalvars_t *gpGlobals; - +bool g_bIsThreeWave; short g_sModelIndexLaser; ItemInfo CBasePlayerItem::ItemInfoArray[MAX_WEAPONS]; diff --git a/cl_dll/quake/quake_events.cpp b/cl_dll/quake/quake_events.cpp index 5fbea81d..b15245df 100644 --- a/cl_dll/quake/quake_events.cpp +++ b/cl_dll/quake/quake_events.cpp @@ -79,15 +79,18 @@ void Game_HookEvents( void ) gEngfuncs.pfnHookEvent( "events/powerup.sc", EV_PlayerPowerup ); - gEngfuncs.pfnHookEvent( "events/door/doorgoup.sc", EV_DMC_DoorGoUp ); + gEngfuncs.pfnHookEvent( "events/door/doorgoup.sc", EV_DMC_DoorGoUp ); gEngfuncs.pfnHookEvent( "events/door/doorgodown.sc", EV_DMC_DoorGoDown ); gEngfuncs.pfnHookEvent( "events/door/doorhittop.sc", EV_DMC_DoorHitTop ); gEngfuncs.pfnHookEvent( "events/door/doorhitbottom.sc", EV_DMC_DoorHitBottom ); - gEngfuncs.pfnHookEvent( "events/hook.sc", EV_Hook ); - gEngfuncs.pfnHookEvent( "events/cable.sc", EV_Cable ); - gEngfuncs.pfnHookEvent( "events/follow.sc", EV_FollowCarrier ); - gEngfuncs.pfnHookEvent( "events/flagspawn.sc", EV_FlagSpawn ); + if( HUD_IsGame( "3wave" ) ) + { + gEngfuncs.pfnHookEvent( "events/hook.sc", EV_Hook ); + gEngfuncs.pfnHookEvent( "events/cable.sc", EV_Cable ); + gEngfuncs.pfnHookEvent( "events/follow.sc", EV_FollowCarrier ); + gEngfuncs.pfnHookEvent( "events/flagspawn.sc", EV_FlagSpawn ); + } - gEngfuncs.pfnHookEvent( "events/train.sc", EV_TrainPitchAdjust ); + gEngfuncs.pfnHookEvent( "events/train.sc", EV_TrainPitchAdjust ); } diff --git a/dlls/client.cpp b/dlls/client.cpp index 229d30f7..45e78801 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -53,7 +53,7 @@ extern DLL_GLOBAL ULONG g_ulFrameCount; const char* GetTeamName( int team ); extern bool g_bHaveMOTD; - +extern bool g_bIsThreeWave; extern void CopyToBodyQue( entvars_t* pev ); extern int giPrecacheGrunt; extern int gmsgSayText; @@ -453,14 +453,17 @@ void Host_Say( edict_t *pEntity, int teamonly ) temp = "say"; // team match? - UTIL_LogPrintf( "\"%s<%i><%s><%s>\" %s \"%s\"\n", - STRING( pEntity->v.netname ), - GETPLAYERUSERID( pEntity ), - GETPLAYERAUTHID( pEntity ), - GetTeamName( pEntity->v.team ), - temp, - p ); - /*if( g_teamplay ) + if( g_bIsThreeWave ) + { + UTIL_LogPrintf( "\"%s<%i><%s><%s>\" %s \"%s\"\n", + STRING( pEntity->v.netname ), + GETPLAYERUSERID( pEntity ), + GETPLAYERAUTHID( pEntity ), + GetTeamName( pEntity->v.team ), + temp, + p ); + } + else if( g_teamplay ) { UTIL_LogPrintf( "\"%s<%i><%s><%s>\" %s \"%s\"\n", STRING( pEntity->v.netname ), @@ -479,7 +482,7 @@ void Host_Say( edict_t *pEntity, int teamonly ) GETPLAYERUSERID( pEntity ), temp, p ); - }*/ + } } /* @@ -563,8 +566,9 @@ void ClientCommand( edict_t *pEntity ) return; //-- Martin Webrant - pPlayer->m_bHadFirstSpawn = true; - // pPlayer->Spawn(); + pPlayer->m_bHadFirstSpawn = true; + if( !g_bIsThreeWave ) + pPlayer->Spawn(); } } else if( FStrEq( pcmd, "lastinv" ) ) @@ -572,7 +576,7 @@ void ClientCommand( edict_t *pEntity ) GetClassPtr( (CBasePlayer *)pev )->SelectLastItem(); } else if( FStrEq( pcmd, "spectate" ) ) // added for proxy support - { + { CBasePlayer * pPlayer = GetClassPtr( (CBasePlayer *)pev ); //++ BulliT @@ -588,6 +592,9 @@ void ClientCommand( edict_t *pEntity ) return; } + if( g_bIsThreeWave ) + return; + //Dont spectate if player is in game in arena. if( pPlayer->IsIngame() && g_pGameRules->m_iGameMode >= ARENA ) return; @@ -678,6 +685,8 @@ void ClientCommand( edict_t *pEntity ) //++ BulliT else if( FStrEq( CMD_ARGV( 0 ), "ready" ) ) { + if( g_bIsThreeWave ) + return; CBasePlayer *pPlayer = GetClassPtr( (CBasePlayer *)pev ); if( g_pGameRules->m_iGameMode >= LMS ) { @@ -704,6 +713,8 @@ void ClientCommand( edict_t *pEntity ) } else if( FStrEq( CMD_ARGV( 0 ), "notready" ) ) { + if( g_bIsThreeWave ) + return; CBasePlayer *pPlayer = GetClassPtr( (CBasePlayer *)pev ); if( g_pGameRules->m_iGameMode >= LMS ) { @@ -835,14 +846,16 @@ void ClientUserInfoChanged( edict_t *pEntity, char *infobuffer ) } // team match? - UTIL_LogPrintf( "\"%s<%i><%s><%s>\" changed name to \"%s\"\n", - STRING( pEntity->v.netname ), - GETPLAYERUSERID( pEntity ), - GETPLAYERAUTHID( pEntity ), - GetTeamName( pEntity->v.team ), - g_engfuncs.pfnInfoKeyValue( infobuffer, "name" ) ); - /* - if( g_teamplay ) + if( g_bIsThreeWave ) + { + UTIL_LogPrintf( "\"%s<%i><%s><%s>\" changed name to \"%s\"\n", + STRING( pEntity->v.netname ), + GETPLAYERUSERID( pEntity ), + GETPLAYERAUTHID( pEntity ), + GetTeamName( pEntity->v.team ), + g_engfuncs.pfnInfoKeyValue( infobuffer, "name" ) ); + } + else if( g_teamplay ) { UTIL_LogPrintf( "\"%s<%i><%s><%s>\" changed name to \"%s\"\n", STRING( pEntity->v.netname ), @@ -859,7 +872,7 @@ void ClientUserInfoChanged( edict_t *pEntity, char *infobuffer ) GETPLAYERAUTHID( pEntity ), GETPLAYERUSERID( pEntity ), g_engfuncs.pfnInfoKeyValue( infobuffer, "name" ) ); - }*/ + } } // QUAKECLASSIC @@ -1128,79 +1141,77 @@ void ClientPrecache( void ) PRECACHE_SOUND( "player/plyrjmp8.wav" ); - PRECACHE_MODEL( "models/rune_resist.mdl" ); - PRECACHE_MODEL( "models/rune_haste.mdl" ); - PRECACHE_MODEL( "models/rune_regen.mdl" ); - PRECACHE_MODEL( "models/rune_strength.mdl" ); + if( g_bIsThreeWave ) + { + PRECACHE_MODEL( "models/rune_resist.mdl" ); + PRECACHE_MODEL( "models/rune_haste.mdl" ); + PRECACHE_MODEL( "models/rune_regen.mdl" ); + PRECACHE_MODEL( "models/rune_strength.mdl" ); - PRECACHE_SOUND( "rune/rune1.wav" ); - PRECACHE_SOUND( "rune/rune2.wav" ); - PRECACHE_SOUND( "rune/rune22.wav" ); // Quad + Strength Rune. - PRECACHE_SOUND( "rune/rune3.wav" ); - PRECACHE_SOUND( "rune/rune4.wav" ); + PRECACHE_SOUND( "rune/rune1.wav" ); + PRECACHE_SOUND( "rune/rune2.wav" ); + PRECACHE_SOUND( "rune/rune22.wav" ); // Quad + Strength Rune. + PRECACHE_SOUND( "rune/rune3.wav" ); + PRECACHE_SOUND( "rune/rune4.wav" ); - PRECACHE_MODEL( "models/hook.mdl" ); - - PRECACHE_MODEL( "sprites/rope.spr" ); + PRECACHE_MODEL( "models/hook.mdl" ); - PRECACHE_SOUND( "weapons/grfire.wav" ); - PRECACHE_SOUND( "weapons/grhang.wav" ); - PRECACHE_SOUND( "weapons/grhit.wav" ); - PRECACHE_SOUND( "weapons/grpull.wav" ); - PRECACHE_SOUND( "weapons/grreset.wav" ); + PRECACHE_MODEL( "sprites/rope.spr" ); - g_usHook = PRECACHE_EVENT( 1, "events/hook.sc" ); - g_usCable = PRECACHE_EVENT( 1, "events/cable.sc" ); - g_usCarried = PRECACHE_EVENT( 1, "events/follow.sc" ); - g_usFlagSpawn = PRECACHE_EVENT( 1, "events/flagspawn.sc" ); + PRECACHE_SOUND( "weapons/grfire.wav" ); + PRECACHE_SOUND( "weapons/grhang.wav" ); + PRECACHE_SOUND( "weapons/grhit.wav" ); + PRECACHE_SOUND( "weapons/grpull.wav" ); + PRECACHE_SOUND( "weapons/grreset.wav" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/p_crowbar.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/p_light.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/p_nail.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/p_nail2.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/p_rock.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/p_rock2.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/p_shot.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/p_shot2.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/spike.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/rocket.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/grenade.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/backpack.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/backpack.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/armor_g.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/armor_r.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/armor_y.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/armor_y.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/b_nail0.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/b_nail1.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/g_light.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/g_nail.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/g_nail2.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/g_rock.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/g_rock2.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/g_shot2.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/pow_invis.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/pow_quad.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/pow_invuln.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/suit.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/w_battery.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/w_batteryl.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/w_medkit.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/w_medkitl.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/w_medkits.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/w_rpgammo.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/w_rpgammo_big.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/w_shotbox.mdl" ); - ENGINE_FORCE_UNMODIFIED( force_exactfile, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ), "models/w_shotbox_big.mdl" ); + g_usHook = PRECACHE_EVENT( 1, "events/hook.sc" ); + g_usCable = PRECACHE_EVENT( 1, "events/cable.sc" ); + g_usCarried = PRECACHE_EVENT( 1, "events/follow.sc" ); + g_usFlagSpawn = PRECACHE_EVENT( 1, "events/flagspawn.sc" ); + } + + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/p_crowbar.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/p_light.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/p_nail.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/p_nail2.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/p_rock.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/p_rock2.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/p_shot.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/p_shot2.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/spike.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/rocket.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/grenade.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/backpack.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/armor_g.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/armor_r.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/armor_y.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/b_nail0.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/b_nail1.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/g_light.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/g_nail.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/g_nail2.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/g_rock.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/g_rock2.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/g_shot2.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/pow_invis.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/pow_quad.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/pow_invuln.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/suit.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/w_battery.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/w_batteryl.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/w_medkit.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/w_medkitl.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/w_medkits.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/w_rpgammo.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/w_rpgammo_big.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/w_shotbox.mdl" ); + ENGINE_FORCE_UNMODIFIED( force_exactfile, g_vecZero, g_vecZero, "models/w_shotbox_big.mdl" ); g_sGibbed = PRECACHE_EVENT( 1, "events/gibs.sc" ); g_sTeleport = PRECACHE_EVENT( 1, "events/teleport.sc" ); g_sTrail = PRECACHE_EVENT( 1, "events/trail.sc" ); g_sExplosion = PRECACHE_EVENT( 1, "events/explosion.sc" ); g_usPowerUp = PRECACHE_EVENT( 1, "events/powerup.sc" ); - - if( giPrecacheGrunt ) - UTIL_PrecacheOther( "monster_human_grunt" ); } /* diff --git a/dlls/dmc/quake_player.cpp b/dlls/dmc/quake_player.cpp index 58a81ff2..82d5a49f 100644 --- a/dlls/dmc/quake_player.cpp +++ b/dlls/dmc/quake_player.cpp @@ -31,6 +31,7 @@ extern entvars_t *g_pevLastInflictor; extern int gmsgStatusText; extern int gmsgStatusValue; extern DLL_GLOBAL Vector g_vecAttackDir; +extern bool g_bIsThreeWave; /*************************************/ /* STATUS BAR */ @@ -116,6 +117,39 @@ int CBasePlayer::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl // keep track of amount of damage last sustained m_lastDamageAmount = flDamage; + if( !g_bIsThreeWave ) + { +//++ BulliT + if( g_pGameRules->m_iGameMode >= LMS ) + { + if( !g_pGameRules->m_LMS.CanTakeDamage() ) + return 0; + } + else if( g_pGameRules->m_iGameMode == ARENA ) + { + if( !g_pGameRules->m_Arena.CanTakeDamage() ) + return 0; + } +//++ BulliT + } + + // team play damage avoidance + if( g_pGameRules->PlayerRelationship( this, pAttacker ) == GR_TEAMMATE ) + { +//++ BulliT + // LTS you can still hurt yourself + if( !g_bIsThreeWave && g_pGameRules->m_iGameMode == LTS && pAttacker != this ) + return 0; +//-- Martin Webrant + // Teamplay 3 you can still hurt yourself + if ( CVAR_GET_FLOAT( "mp_teamplay" ) == 3 && pAttacker != this ) + return 0; + // Teamplay 1 can't hurt any teammates, including yourself + if ( CVAR_GET_FLOAT( "mp_teamplay" ) == 1 ) + return 0; + // Teamplay 2 you can still hurt teammates + } + // check for quad damage powerup on the attacker if (pAttacker->IsPlayer()) { @@ -138,36 +172,6 @@ int CBasePlayer::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl flDamage /= 2; EMIT_SOUND( ENT( pev ), CHAN_ITEM, "rune/rune1.wav", 1, ATTN_NORM ); } -//++ BulliT - if( g_pGameRules->m_iGameMode >= LMS ) - { - if( !g_pGameRules->m_LMS.CanTakeDamage() ) - return 0; - } - else if( g_pGameRules->m_iGameMode == ARENA ) - { - if( !g_pGameRules->m_Arena.CanTakeDamage() ) - return 0; - } -//++ BulliT - - // team play damage avoidance - if ( g_pGameRules->PlayerRelationship( this, pAttacker ) == GR_TEAMMATE ) - { -//++ BulliT - // LTS you can still hurt yourself - if ( g_pGameRules->m_iGameMode == LTS && pAttacker != this ) - return 0; -//-- Martin Webrant - // Teamplay 3 you can still hurt yourself - if ( CVAR_GET_FLOAT( "mp_teamplay" ) == 3 && pAttacker != this ) - return 0; - // Teamplay 1 can't hurt any teammates, including yourself - if ( CVAR_GET_FLOAT( "mp_teamplay" ) == 1 ) - return 0; - // Teamplay 2 you can still hurt teammates - } - // save damage based on the target's armor level float flSave = ceil(pev->armortype * flDamage); diff --git a/dlls/dmc/quake_weapons_all.cpp b/dlls/dmc/quake_weapons_all.cpp index 8020cb4d..a4a75238 100644 --- a/dlls/dmc/quake_weapons_all.cpp +++ b/dlls/dmc/quake_weapons_all.cpp @@ -35,6 +35,8 @@ extern unsigned short g_usHook; extern unsigned short g_usCable; extern unsigned short g_usCarried; +extern bool g_bIsThreeWave; + #ifdef CLIENT_DLL #include "cl_entity.h" struct cl_entity_s *GetViewEntity( void ); @@ -110,7 +112,8 @@ void QuakeClassicPrecache( void ) PRECACHE_SOUND("items/itembk2.wav"); PRECACHE_MODEL("models/backpack.mdl"); - PRECACHE_MODEL("models/v_grapple.mdl"); + if( g_bIsThreeWave ) + PRECACHE_MODEL("models/v_grapple.mdl"); } //================================================================================================ diff --git a/dlls/gamerules.cpp b/dlls/gamerules.cpp index 2756f92c..9e4b0a44 100644 --- a/dlls/gamerules.cpp +++ b/dlls/gamerules.cpp @@ -25,11 +25,12 @@ #include "teamplay_gamerules.h" #include "skill.h" #include "game.h" +#include "threewave_gamerules.h" extern Vector g_vecTeleMins[MAX_TELES]; extern Vector g_vecTeleMaxs[MAX_TELES]; extern int g_iTeleNum; - +extern bool g_bIsThreeWave; extern edict_t *EntSelectSpawnPoint( CBaseEntity *pPlayer, bool bCheckDM ); DLL_GLOBAL CGameRules *g_pGameRules = NULL; @@ -164,7 +165,11 @@ CGameRules *InstallGameRules( void ) } else { - if( CVAR_GET_FLOAT( "mp_teamplay" ) >= LTS ) + if( g_bIsThreeWave ) + { + return new CThreeWave; + } + else if( CVAR_GET_FLOAT( "mp_teamplay" ) >= LTS ) { // lts return new CHalfLifeTeamplay; diff --git a/dlls/h_export.cpp b/dlls/h_export.cpp index a3f4f35e..60c82853 100644 --- a/dlls/h_export.cpp +++ b/dlls/h_export.cpp @@ -30,6 +30,8 @@ enginefuncs_t g_engfuncs; globalvars_t *gpGlobals; server_physics_api_t g_physfuncs; +bool g_bIsThreeWave; + #ifdef _WIN32 // Required DLL entry point @@ -52,6 +54,13 @@ BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) extern "C" void DLLEXPORT EXPORT2 GiveFnptrsToDll( enginefuncs_t *pengfuncsFromEngine, globalvars_t *pGlobals ) { + char gamedir[256]; + memcpy( &g_engfuncs, pengfuncsFromEngine, sizeof(enginefuncs_t) ); gpGlobals = pGlobals; + + GET_GAME_DIR( gamedir ); + + if( FStrEq( gamedir, "3wave" ) ) + g_bIsThreeWave = true; } diff --git a/dlls/multiplay_gamerules.cpp b/dlls/multiplay_gamerules.cpp index ea73cdda..8a81cc17 100644 --- a/dlls/multiplay_gamerules.cpp +++ b/dlls/multiplay_gamerules.cpp @@ -39,6 +39,7 @@ extern int gmsgMOTD; extern int gmsgServerName; extern int g_teamplay; +extern bool g_bIsThreeWave; bool g_bHaveMOTD; @@ -248,12 +249,16 @@ void CHalfLifeMultiplay::Think( void ) return; } + if( !g_bIsThreeWave ) + { //++ BulliT - if( g_pGameRules->m_iGameMode == LMS ) - m_LMS.Think(); - else if( g_pGameRules->m_iGameMode == ARENA ) - m_Arena.Think(); + if( g_pGameRules->m_iGameMode == LMS ) + m_LMS.Think(); + else if( g_pGameRules->m_iGameMode == ARENA ) + m_Arena.Think(); //-- Martin Webrant + } + if( m_flGameEndTime != 0.0 && m_flGameEndTime <= gpGlobals->time ) { GoToIntermission(); @@ -469,13 +474,15 @@ void CHalfLifeMultiplay::InitHUD( CBasePlayer *pl ) ( pl->pev->netname && ( STRING( pl->pev->netname ) )[0] != 0 ) ? STRING( pl->pev->netname ) : "unconnected" ) ); // team match? - UTIL_LogPrintf( "\"%s<%i><%s><%s>\" entered the game\n", - STRING( pl->pev->netname ), - GETPLAYERUSERID( pl->edict() ), - GETPLAYERAUTHID( pl->edict() ), - GetTeamName( pl->pev->team ) ); - /* - if( g_teamplay ) + if( g_bIsThreeWave ) + { + UTIL_LogPrintf( "\"%s<%i><%s><%s>\" entered the game\n", + STRING( pl->pev->netname ), + GETPLAYERUSERID( pl->edict() ), + GETPLAYERAUTHID( pl->edict() ), + GetTeamName( pl->pev->team ) ); + } + else if( g_teamplay ) { UTIL_LogPrintf( "\"%s<%i><%s><%s>\" entered the game\n", STRING( pl->pev->netname ), @@ -490,7 +497,7 @@ void CHalfLifeMultiplay::InitHUD( CBasePlayer *pl ) GETPLAYERUSERID( pl->edict() ), GETPLAYERAUTHID( pl->edict() ), GETPLAYERUSERID( pl->edict() ) ); - }*/ + } UpdateGameMode( pl ); @@ -539,23 +546,28 @@ void CHalfLifeMultiplay::ClientDisconnected( edict_t *pClient ) if( pPlayer ) { + if( !g_bIsThreeWave ) + { //++ BulliT - if( g_pGameRules->m_iGameMode >= LMS ) - m_LMS.ClientDisconnected( pPlayer ); - else if( g_pGameRules->m_iGameMode == ARENA ) - m_Arena.ClientDisconnected( pPlayer ); + if( g_pGameRules->m_iGameMode >= LMS ) + m_LMS.ClientDisconnected( pPlayer ); + else if( g_pGameRules->m_iGameMode == ARENA ) + m_Arena.ClientDisconnected( pPlayer ); //-- Martin Webrant + } FireTargets( "game_playerleave", pPlayer, pPlayer, USE_TOGGLE, 0 ); // team match? - UTIL_LogPrintf( "\"%s<%i><%s><%s>\" disconnected\n", - STRING( pPlayer->pev->netname ), - GETPLAYERUSERID( pPlayer->edict() ), - GETPLAYERAUTHID( pPlayer->edict() ), - GetTeamName( pPlayer->pev->team ) ); - - /*if( g_teamplay ) + if( g_bIsThreeWave ) + { + UTIL_LogPrintf( "\"%s<%i><%s><%s>\" disconnected\n", + STRING( pPlayer->pev->netname ), + GETPLAYERUSERID( pPlayer->edict() ), + GETPLAYERAUTHID( pPlayer->edict() ), + GetTeamName( pPlayer->pev->team ) ); + } + else if( g_teamplay ) { UTIL_LogPrintf( "\"%s<%i><%s><%s>\" disconnected\n", STRING( pPlayer->pev->netname ), @@ -570,7 +582,7 @@ void CHalfLifeMultiplay::ClientDisconnected( edict_t *pClient ) GETPLAYERUSERID( pPlayer->edict() ), GETPLAYERAUTHID( pPlayer->edict() ), GETPLAYERUSERID( pPlayer->edict() ) ); - }*/ + } pPlayer->RemoveAllItems( TRUE );// destroy all of the players weapons and items } @@ -648,7 +660,7 @@ void CHalfLifeMultiplay::PlayerSpawn( CBasePlayer *pPlayer ) pPlayer->GiveNamedItem( "weapon_quakegun" ); //++ BulliT - if( g_pGameRules->m_iGameMode >= ARENA ) + if( !g_bIsThreeWave && g_pGameRules->m_iGameMode >= ARENA ) { pPlayer->m_iQuakeItems |= ( IT_AXE | IT_SHOTGUN | IT_SUPER_SHOTGUN | IT_NAILGUN | IT_SUPER_NAILGUN | IT_GRENADE_LAUNCHER | IT_ROCKET_LAUNCHER | IT_LIGHTNING ); pPlayer->m_iAmmoRockets = 100; @@ -866,14 +878,16 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller, // killed self // team match? - UTIL_LogPrintf( "\"%s<%i><%s><%s>\" committed suicide with \"%s\"\n", - STRING( pVictim->pev->netname ), - GETPLAYERUSERID( pVictim->edict() ), - GETPLAYERAUTHID( pVictim->edict() ), - GetTeamName( pVictim->pev->team ), - killer_weapon_name ); - /* - if( g_teamplay ) + if( g_bIsThreeWave ) + { + UTIL_LogPrintf( "\"%s<%i><%s><%s>\" committed suicide with \"%s\"\n", + STRING( pVictim->pev->netname ), + GETPLAYERUSERID( pVictim->edict() ), + GETPLAYERAUTHID( pVictim->edict() ), + GetTeamName( pVictim->pev->team ), + killer_weapon_name ); + } + else if( g_teamplay ) { UTIL_LogPrintf( "\"%s<%i><%s><%s>\" committed suicide with \"%s\"\n", STRING( pVictim->pev->netname ), @@ -890,22 +904,25 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller, GETPLAYERAUTHID( pVictim->edict() ), GETPLAYERUSERID( pVictim->edict() ), killer_weapon_name ); - }*/ + } } else if( pKiller->flags & FL_CLIENT ) { // team match? - UTIL_LogPrintf( "\"%s<%i><%s><%s>\" killed \"%s<%i><%s><%s>\" with \"%s\"\n", - STRING( pKiller->netname ), - GETPLAYERUSERID( ENT(pKiller) ), - GETPLAYERAUTHID( ENT(pKiller) ), - GetTeamName( pKiller->team ), - STRING( pVictim->pev->netname ), - GETPLAYERUSERID( pVictim->edict() ), - GETPLAYERAUTHID( pVictim->edict() ), - GetTeamName( pVictim->pev->team ), - killer_weapon_name ); - /*if( g_teamplay ) + if( g_bIsThreeWave ) + { + UTIL_LogPrintf( "\"%s<%i><%s><%s>\" killed \"%s<%i><%s><%s>\" with \"%s\"\n", + STRING( pKiller->netname ), + GETPLAYERUSERID( ENT(pKiller) ), + GETPLAYERAUTHID( ENT(pKiller) ), + GetTeamName( pKiller->team ), + STRING( pVictim->pev->netname ), + GETPLAYERUSERID( pVictim->edict() ), + GETPLAYERAUTHID( pVictim->edict() ), + GetTeamName( pVictim->pev->team ), + killer_weapon_name ); + } + else if( g_teamplay ) { UTIL_LogPrintf( "\"%s<%i><%s><%s>\" killed \"%s<%i><%s><%s>\" with \"%s\"\n", STRING( pKiller->netname ), @@ -930,21 +947,23 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller, GETPLAYERAUTHID( pVictim->edict() ), GETPLAYERUSERID( pVictim->edict() ), killer_weapon_name ); - }*/ + } } else { // killed by the world // team match? - UTIL_LogPrintf( "\"%s<%i><%s><%s>\" committed suicide with \"%s\" (world)\n", - STRING( pVictim->pev->netname ), - GETPLAYERUSERID( pVictim->edict() ), - GETPLAYERAUTHID( pVictim->edict() ), - GetTeamName( pVictim->pev->team ), - killer_weapon_name ); - - /*if( g_teamplay ) + if( g_bIsThreeWave ) + { + UTIL_LogPrintf( "\"%s<%i><%s><%s>\" committed suicide with \"%s\" (world)\n", + STRING( pVictim->pev->netname ), + GETPLAYERUSERID( pVictim->edict() ), + GETPLAYERAUTHID( pVictim->edict() ), + GetTeamName( pVictim->pev->team ), + killer_weapon_name ); + } + else if( g_teamplay ) { UTIL_LogPrintf( "\"%s<%i><%s><%s>\" committed suicide with \"%s\" (world)\n", STRING( pVictim->pev->netname ), @@ -961,7 +980,7 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller, GETPLAYERAUTHID( pVictim->edict() ), GETPLAYERUSERID( pVictim->edict() ), killer_weapon_name ); - }*/ + } } MESSAGE_BEGIN( MSG_SPEC, SVC_DIRECTOR ); diff --git a/dlls/player.cpp b/dlls/player.cpp index c5f83e93..99f28a61 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -62,6 +62,7 @@ extern void CopyToBodyQue( entvars_t *pev); extern void respawn( entvars_t *pev, BOOL fCopyCorpse ); extern Vector VecBModelOrigin( entvars_t *pevBModel ); extern edict_t *EntSelectSpawnPoint( CBaseEntity *pPlayer, bool bCheckDM ); +extern bool g_bIsThreeWave; // the world node graph extern CGraph WorldGraph; @@ -638,7 +639,7 @@ void CBasePlayer::Killed( entvars_t *pevAttacker, int iGib ) pev->angles.z = 0; //++ BulliT - if( g_pGameRules->m_iGameMode >= ARENA ) + if( !g_bIsThreeWave && g_pGameRules->m_iGameMode >= ARENA ) m_iQuakeWeapon = 0; //-- Martin Webrant SetThink( &CBasePlayer::PlayerDeathThink ); @@ -4712,7 +4713,11 @@ LINK_ENTITY_TO_CLASS( info_intermission, CInfoIntermission ) void CBasePlayer::Init() { m_bReady = true; - m_bIngame = g_pGameRules->m_iGameMode < ARENA; + m_bIngame = ( g_bIsThreeWave || g_pGameRules->m_iGameMode < ARENA ); + + if( g_bIsThreeWave ) + return; + if( g_pGameRules->m_iGameMode >= LMS ) g_pGameRules->m_LMS.ClientConnected( this ); else if( g_pGameRules->m_iGameMode == ARENA ) diff --git a/dlls/teamplay_gamerules.cpp b/dlls/teamplay_gamerules.cpp index b8fed438..aa707048 100644 --- a/dlls/teamplay_gamerules.cpp +++ b/dlls/teamplay_gamerules.cpp @@ -30,6 +30,7 @@ static int team_scores[MAX_TEAMS]; static int num_teams = 0; extern DLL_GLOBAL BOOL g_fGameOver; +extern bool g_bIsThreeWave; CHalfLifeTeamplay::CHalfLifeTeamplay() { @@ -92,7 +93,7 @@ void CHalfLifeTeamplay::Think( void ) } //++ BulliT - if( g_pGameRules->m_iGameMode == LTS ) + if( !g_bIsThreeWave && g_pGameRules->m_iGameMode == LTS ) m_LMS.Think(); if( m_iGameMode != CVAR_GET_FLOAT( "mp_teamplay" ) ) diff --git a/engine/eiface.h b/engine/eiface.h index f6cf2f51..b3b759e0 100644 --- a/engine/eiface.h +++ b/engine/eiface.h @@ -241,7 +241,7 @@ typedef struct enginefuncs_s // Forces the client and server to be running with the same version of the specified file // ( e.g., a player model ). // Calling this has no effect in single player - void (*pfnForceUnmodified)( FORCE_TYPE type, float *mins, float *maxs, const char *filename ); + void (*pfnForceUnmodified)( FORCE_TYPE type, const float *mins, const float *maxs, const char *filename ); void (*pfnGetPlayerStats)( const edict_t *pClient, int *ping, int *packet_loss );