From: LegendaryGuard Date: Sat, 25 Jun 2022 19:10:41 +0000 (+0200) Subject: Remove unnecessary .variable for spawnturret function X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=dbcc0b12c3b3c1b48f5a3274fce62118a2074569;p=xonotic%2Fxonotic-data.pk3dir.git Remove unnecessary .variable for spawnturret function --- diff --git a/qcsrc/common/turrets/sv_turrets.qc b/qcsrc/common/turrets/sv_turrets.qc index c88727aa81..6c5b1a9d04 100644 --- a/qcsrc/common/turrets/sv_turrets.qc +++ b/qcsrc/common/turrets/sv_turrets.qc @@ -1419,7 +1419,6 @@ bool turret_initialize(entity this, Turret tur) entity spawnturret (entity e, string turret, Turret tur, entity spawnedby, entity own, vector orig, bool respwn, bool invincible, bool removeifinvalid, int moveflag, bool optional) { e.spawnflags = TSF_SUSPENDED; - e.optionalsetup = optional; if(!respwn) { e.spawnflags |= TSL_NO_RESPAWN; } if(invincible) { e.damage_flags |= TFL_DMG_NO; } @@ -1464,16 +1463,15 @@ entity spawnturret (entity e, string turret, Turret tur, entity spawnedby, entit e.realowner = spawnedby; - if(moveflag) - e.turret_flags = TUR_FLAG_MOVE; - if(IS_PLAYER(spawnedby)) { if(teamplay) e.team = spawnedby.team; // colors handled in spawn code // TODO: Create a "following player" feature when turret has moveflag - //if(autocvar_g_monsters_owners && e.move_movetype == MOVETYPE_WALK) + // if(moveflag) + // e.turret_flags = TUR_FLAG_MOVE; + // if(autocvar_g_monsters_owners && e.move_movetype == MOVETYPE_WALK) // e.monster_follow = own; // using .owner makes the monster non-solid for its master e.angles_y = spawnedby.angles_y; @@ -1485,7 +1483,7 @@ entity spawnturret (entity e, string turret, Turret tur, entity spawnedby, entit //LOG_INFOF("^1tur.netname^3: %s", tur.netname); - if (e.optionalsetup) + if (optional) e.tur_head.effects = (EF_DIMLIGHT | EF_FULLBRIGHT); return e; diff --git a/qcsrc/common/turrets/sv_turrets.qh b/qcsrc/common/turrets/sv_turrets.qh index 1bd0b43aae..f7a426351f 100644 --- a/qcsrc/common/turrets/sv_turrets.qh +++ b/qcsrc/common/turrets/sv_turrets.qh @@ -26,7 +26,6 @@ TR_PROPS_COMMON(X, , ) .float shot_volly_refire; // refire after completed volly */ -.bool optionalsetup; // optional setup .float ticrate; // interal ai think rate .entity tur_head; // top part of the turret .entity tur_defend; // defend this entity