]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/weaponsystem.qc
Some more defs.qh cleanup, update gameplay hash (again)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / weaponsystem.qc
index 59812425d674cbe83100c535b2e40b02a1d8dac7..cbfba4c9f3ef4ae7b2b75d29b4bb559a53c7ab44 100644 (file)
@@ -3,14 +3,16 @@
 #include "selection.qh"
 
 #include "../command/common.qh"
+#include <server/g_damage.qh>
+#include <server/items/items.qh>
 #include <server/mutators/_mod.qh>
 #include "../round_handler.qh"
 #include <server/cheats.qh>
 #include <server/resources.qh>
-#include <common/t_items.qh>
 #include <common/animdecide.qh>
 #include <common/constants.qh>
 #include <common/net_linked.qh>
+#include <common/mapobjects/platforms.qh>
 #include <common/monsters/_mod.qh>
 #include <common/notifications/all.qh>
 #include <common/util.qh>
@@ -55,7 +57,7 @@ bool CL_Weaponentity_CustomizeEntityForClient(entity this, entity client)
 
 vector CL_Weapon_GetShotOrg(int wpn)
 {
-       entity wi = Weapons_from(wpn);
+       entity wi = REGISTRY_GET(Weapons, wpn);
        entity e = spawn();
        CL_WeaponEntity_SetModel(e, wi.mdl, false);
        vector ret = e.movedir;
@@ -366,6 +368,9 @@ void weapon_thinkf(entity actor, .entity weaponentity, WFRAME fr, float t, void(
        bool restartanim;
        if (fr == WFRAME_DONTCHANGE)
        {
+               // this can happen when the weapon entity is newly spawned, since it has a clear state and no previous weapon frame
+               if (this.wframe == WFRAME_DONTCHANGE)
+                       this.wframe = WFRAME_IDLE;
                fr = this.wframe;
                restartanim = false;
        }
@@ -843,7 +848,7 @@ void W_Reload(entity actor, .entity weaponentity, float sent_ammo_min, Sound sen
 
 void W_DropEvent(.void(Weapon, entity actor, .entity) event, entity player, float weapon_type, entity weapon_item, .entity weaponentity)
 {
-       Weapon w = Weapons_from(weapon_type);
+       Weapon w = REGISTRY_GET(Weapons, weapon_type);
        weapon_dropevent_item = weapon_item;
        w.event(w, player, weaponentity);
 }