]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix another weaponentities[0]
authorMario <mario@smbclan.net>
Mon, 8 Aug 2016 11:35:39 +0000 (21:35 +1000)
committerMario <mario@smbclan.net>
Mon, 8 Aug 2016 11:35:39 +0000 (21:35 +1000)
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/mutators/mutator/overkill/overkill.qc
qcsrc/server/cl_client.qc

index f03a51368628b06b9d41d7dbf5002934ad6decaf..f189d2652889a96d0d84a2d4d903bcce85f3c679 100644 (file)
@@ -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);
index 12f50875833cd38796a9e1dd2132cb85ff89c8d6..f49fdc11b4a2901a3038257ecd8b9cf2f7990060 100644 (file)
@@ -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),
index 9f66a4771ef080d6cd2ecf066d1874ba1fbb3670..0a608e979bff5da3e4b535fed7019bc0a9fb2301 100644 (file)
@@ -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);