From: Mario Date: Mon, 8 Aug 2016 11:35:39 +0000 (+1000) Subject: Fix another weaponentities[0] X-Git-Tag: xonotic-v0.8.2~723^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=82752c7ebe266d9bc29c6a8e352542d1d39dc984;p=xonotic%2Fxonotic-data.pk3dir.git Fix another weaponentities[0] --- diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index f03a51368..f189d2652 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -899,13 +899,17 @@ void Monster_Remove(entity this) if(IS_CLIENT(this)) return; // don't remove it? - .entity weaponentity = weaponentities[0]; if(!this) { return; } if(!MUTATOR_CALLHOOK(MonsterRemove, this)) Send_Effect(EFFECT_ITEM_PICKUP, this.origin, '0 0 0', 1); - if(this.(weaponentity)) { delete(this.(weaponentity)); } + for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) + { + .entity weaponentity = weaponentities[slot]; + if(this.(weaponentity)) + delete(this.(weaponentity)); + } if(this.iceblock) { delete(this.iceblock); } WaypointSprite_Kill(this.sprite); delete(this); diff --git a/qcsrc/common/mutators/mutator/overkill/overkill.qc b/qcsrc/common/mutators/mutator/overkill/overkill.qc index 12f508758..f49fdc11b 100644 --- a/qcsrc/common/mutators/mutator/overkill/overkill.qc +++ b/qcsrc/common/mutators/mutator/overkill/overkill.qc @@ -227,7 +227,7 @@ MUTATOR_HOOKFUNCTION(ok, PlayerPreThink) PS(player).m_weapon = WEP_BLASTER; W_Blaster_Attack( player, - weaponentities[0], + weaponentities[0], // TODO: unhardcode WEP_BLASTER.m_id | HITTYPE_SECONDARY, WEP_CVAR_SEC(vaporizer, shotangle), WEP_CVAR_SEC(vaporizer, damage), diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 9f66a4771..0a608e979 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -2379,7 +2379,10 @@ void PlayerPreThink (entity this) this.items &= ~this.items_added; //for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) - //W_WeaponFrame(this, weaponentities[slot]); + //{ + //.entity weaponentity = weaponentities[slot]; + //W_WeaponFrame(this, weaponentity); + //} .entity weaponentity = weaponentities[0]; // TODO W_WeaponFrame(this, weaponentity);