X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fserver%2Fweapons%2Fthrowing.qc;h=30b700098d4a056d150ba589ce39d57b1376ff99;hb=451e02a2857d8c671f6dcf6a0639ea7c609b3ba9;hp=f1977c8f0c0ddf3ddb958900d8a5dbc1cda2a5e9;hpb=daab9330abb8952053b47239d1322cd029b08cd1;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/throwing.qc b/qcsrc/server/weapons/throwing.qc index f1977c8f0..30b700098 100644 --- a/qcsrc/server/weapons/throwing.qc +++ b/qcsrc/server/weapons/throwing.qc @@ -1,7 +1,7 @@ #include "throwing.qh" #include "weaponsystem.qh" -#include "../mutators/all.qh" +#include "../mutators/_mod.qh" #include #include "../g_damage.qh" #include @@ -9,18 +9,21 @@ #include #include #include -#include +#include #include -void thrown_wep_think() -{SELFPARAM(); +void thrown_wep_think(entity this) +{ this.nextthink = time; if(this.oldorigin != this.origin) { this.SendFlags |= ISF_LOCATION; this.oldorigin = this.origin; + this.bot_pickup = false; } - this.owner = world; + else + this.bot_pickup = true; + this.owner = NULL; float timeleft = this.savenextthink - time; if(timeleft > 1) SUB_SetFade(this, this.savenextthink - 1, 1); @@ -45,6 +48,7 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto wep.owner = wep.enemy = own; wep.flags |= FL_TOSSED; wep.colormap = own.colormap; + wep.glowmod = weaponentity_glowmod(info, own, own.clientcolors); W_DropEvent(wr_drop,own,wpn,wep); @@ -79,7 +83,6 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto weapon_defaultspawnfunc(wep, info); if(startitem_failed) return string_null; - wep.glowmod = weaponentity_glowmod(info, own.clientcolors); setthink(wep, thrown_wep_think); wep.savenextthink = wep.nextthink; wep.nextthink = min(wep.nextthink, time + 0.5); @@ -165,7 +168,7 @@ bool W_IsWeaponThrowable(entity this, int w) } // toss current weapon -void W_ThrowWeapon(entity this, vector velo, vector delta, float doreduce) +void W_ThrowWeapon(entity this, .entity weaponentity, vector velo, vector delta, float doreduce) { Weapon w = PS(this).m_weapon; if (w == WEP_Null) @@ -174,7 +177,6 @@ void W_ThrowWeapon(entity this, vector velo, vector delta, float doreduce) return; if(!autocvar_g_weapon_throwable) return; - .entity weaponentity = weaponentities[0]; // TODO: unhardcode if(this.(weaponentity).state != WS_READY) return; if(!W_IsWeaponThrowable(this, w.m_id))