Trying to remove more dependencies from xatrix and rogue

This commit is contained in:
Aaron Dean 2023-09-06 15:22:15 -04:00
parent e6f86e95bc
commit 30c57b17b4
10 changed files with 69 additions and 67 deletions

View file

@ -38,8 +38,8 @@ set(GAME_SRC
${CMAKE_CURRENT_SOURCE_DIR}/g_utils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/g_weapon.cpp
${CMAKE_CURRENT_SOURCE_DIR}/m_actor.cpp
${CMAKE_CURRENT_SOURCE_DIR}/m_infantry.cpp
${CMAKE_CURRENT_SOURCE_DIR}/m_medic.cpp
# ${CMAKE_CURRENT_SOURCE_DIR}/m_infantry.cpp
# ${CMAKE_CURRENT_SOURCE_DIR}/m_medic.cpp
${CMAKE_CURRENT_SOURCE_DIR}/m_move.cpp
${CMAKE_CURRENT_SOURCE_DIR}/p_client.cpp
${CMAKE_CURRENT_SOURCE_DIR}/p_hud.cpp

View file

@ -538,16 +538,16 @@ void T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, const vec3_t
// ROGUE
// allow the deathmatch game to change values
if (deathmatch->integer && gamerules->integer)
{
if (DMGame.ChangeDamage)
damage = DMGame.ChangeDamage(targ, attacker, damage, mod);
if (DMGame.ChangeKnockback)
knockback = DMGame.ChangeKnockback(targ, attacker, knockback, mod);
// if (deathmatch->integer && gamerules->integer)
// {
// if (DMGame.ChangeDamage)
// damage = DMGame.ChangeDamage(targ, attacker, damage, mod);
// if (DMGame.ChangeKnockback)
// knockback = DMGame.ChangeKnockback(targ, attacker, knockback, mod);
if (!damage)
return;
}
// if (!damage)
// return;
// }
// ROGUE
// easy mode takes half damage

View file

@ -1112,6 +1112,8 @@ void SpawnItem(edict_t *ent, gitem_t *item)
// // ROGUE
// //=====
// }
}
if (g_no_health->integer)
{
if (item->flags & IF_HEALTH)

View file

@ -2716,10 +2716,10 @@ void PredictAim(edict_t *self, edict_t *target, const vec3_t &start, float bolt_
bool M_CalculatePitchToFire(edict_t *self, const vec3_t &target, const vec3_t &start, vec3_t &aim, float speed, float time_remaining, bool mortar, bool destroy_on_touch = false);
bool below(edict_t *self, edict_t *other);
void drawbbox(edict_t *self);
void M_MonsterDodge(edict_t *self, edict_t *attacker, gtime_t eta, trace_t *tr, bool gravity);
void monster_duck_down(edict_t *self);
void monster_duck_hold(edict_t *self);
void monster_duck_up(edict_t *self);
//void M_MonsterDodge(edict_t *self, edict_t *attacker, gtime_t eta, trace_t *tr, bool gravity);
// void monster_duck_down(edict_t *self);
// void monster_duck_hold(edict_t *self);
// void monster_duck_up(edict_t *self);
bool has_valid_enemy(edict_t *self);
//void TargetTesla(edict_t *self, edict_t *tesla);
//void hintpath_stop(edict_t *self);

View file

@ -782,11 +782,11 @@ void CheckDMRules()
//=======
// ROGUE
if (gamerules->integer && DMGame.CheckDMRules)
{
if (DMGame.CheckDMRules())
return;
}
// if (gamerules->integer && DMGame.CheckDMRules)
// {
// if (DMGame.CheckDMRules())
// return;
// }
// ROGUE
//=======

View file

@ -44,12 +44,12 @@ void monster_fire_blaster(edict_t *self, const vec3_t &start, const vec3_t &dir,
monster_muzzleflash(self, start, flashtype);
}
void monster_fire_flechette(edict_t *self, const vec3_t &start, const vec3_t &dir, int damage, int speed,
monster_muzzleflash_id_t flashtype)
{
fire_flechette(self, start, dir, damage, speed, damage / 2);
monster_muzzleflash(self, start, flashtype);
}
// void monster_fire_flechette(edict_t *self, const vec3_t &start, const vec3_t &dir, int damage, int speed,
// monster_muzzleflash_id_t flashtype)
// {
// fire_flechette(self, start, dir, damage, speed, damage / 2);
// monster_muzzleflash(self, start, flashtype);
// }
void monster_fire_grenade(edict_t *self, const vec3_t &start, const vec3_t &aimdir, int damage, int speed,
monster_muzzleflash_id_t flashtype, float right_adjust, float up_adjust)

View file

@ -1259,11 +1259,11 @@ void SpawnEntities(const char *mapname, const char *entities, const char *spawnp
// ROGUE
// ROGUE -- allow dm games to do init stuff right before game starts.
if (deathmatch->integer && gamerules->integer)
{
if (DMGame.PostInitSetup)
DMGame.PostInitSetup();
}
// if (deathmatch->integer && gamerules->integer)
// {
// if (DMGame.PostInitSetup)
// DMGame.PostInitSetup();
// }
// ROGUE
setup_shadow_lights();

View file

@ -1388,11 +1388,11 @@ DIE(player_die) (edict_t *self, edict_t *inflictor, edict_t *attacker, int damag
}
}
if (gamerules->integer) // if we're in a dm game, alert the game
{
if (DMGame.PlayerDeath)
DMGame.PlayerDeath(self, inflictor, attacker);
}
// if (gamerules->integer) // if we're in a dm game, alert the game
// {
// if (DMGame.PlayerDeath)
// DMGame.PlayerDeath(self, inflictor, attacker);
// }
// remove powerups
self->client->quad_time = 0_ms;
@ -2767,8 +2767,8 @@ void PutClientInServer(edict_t *ent)
spawn_angles = squad_respawn_angles;
valid_spawn = true;
}
else if (gamerules->integer && DMGame.SelectSpawnPoint) // PGM
valid_spawn = DMGame.SelectSpawnPoint(ent, spawn_origin, spawn_angles, force_spawn); // PGM
// else if (gamerules->integer && DMGame.SelectSpawnPoint) // PGM
// valid_spawn = DMGame.SelectSpawnPoint(ent, spawn_origin, spawn_angles, force_spawn); // PGM
else // PGM
valid_spawn = SelectSpawnPoint(ent, spawn_origin, spawn_angles, force_spawn, is_landmark);
@ -3072,10 +3072,10 @@ void ClientBeginDeathmatch(edict_t *ent)
InitClientResp(ent->client);
// PGM
if (gamerules->integer && DMGame.ClientBegin)
{
DMGame.ClientBegin(ent);
}
// if (gamerules->integer && DMGame.ClientBegin)
// {
// DMGame.ClientBegin(ent);
// }
// PGM
// locate ent at a spawn point
@ -3695,21 +3695,21 @@ void ClientDisconnect(edict_t *ent)
//============
// ROGUE
// make sure no trackers are still hurting us.
if (ent->client->tracker_pain_time)
RemoveAttackingPainDaemons(ent);
// if (ent->client->tracker_pain_time)
// RemoveAttackingPainDaemons(ent);
if (ent->client->owned_sphere)
{
if (ent->client->owned_sphere->inuse)
G_FreeEdict(ent->client->owned_sphere);
ent->client->owned_sphere = nullptr;
}
// if (ent->client->owned_sphere)
// {
// if (ent->client->owned_sphere->inuse)
// G_FreeEdict(ent->client->owned_sphere);
// ent->client->owned_sphere = nullptr;
// }
if (gamerules->integer)
{
if (DMGame.PlayerDisconnect)
DMGame.PlayerDisconnect(ent);
}
// if (gamerules->integer)
// {
// if (DMGame.PlayerDisconnect)
// DMGame.PlayerDisconnect(ent);
// }
// ROGUE
//============

View file

@ -460,11 +460,11 @@ void DeathmatchScoreboardMessage(edict_t *ent, edict_t *killer)
//===============
// ROGUE
// allow new DM games to override the tag picture
if (gamerules->integer)
{
if (DMGame.DogTag)
DMGame.DogTag(cl_ent, killer, &tag);
}
// if (gamerules->integer)
// {
// if (DMGame.DogTag)
// DMGame.DogTag(cl_ent, killer, &tag);
// }
// ROGUE
//===============

View file

@ -883,14 +883,14 @@ void G_SetClientEffects(edict_t *ent)
//=========
// PGM
if (ent->flags & FL_DISGUISED)
ent->s.renderfx |= RF_USE_DISGUISE;
// if (ent->flags & FL_DISGUISED)
// ent->s.renderfx |= RF_USE_DISGUISE;
if (gamerules->integer)
{
if (DMGame.PlayerEffects)
DMGame.PlayerEffects(ent);
}
// if (gamerules->integer)
// {
// if (DMGame.PlayerEffects)
// DMGame.PlayerEffects(ent);
// }
// PGM
//=========