X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fweaponsystem.qc;h=011d5cbc11b19c13ca5b946d4dd75fabd4e9f51c;hb=defe7ea25b8d1cc20b5c302104854db5666e6fcc;hp=2f6fcb68d7213cbafc508343d377da932944ad0a;hpb=b945d959784e5b249c66aea4f3326d8ae048f1cd;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 2f6fcb68d..011d5cbc1 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -418,7 +418,7 @@ void weapon_thinkf(entity actor, .entity weaponentity, WFRAME fr, float t, void( bool forbidWeaponUse(entity player) { - if (time < game_starttime && !autocvar_sv_ready_restart_after_countdown) return true; + if (time < game_starttime && !sv_ready_restart_after_countdown) return true; if (player.player_blocked) return true; if (game_stopped) return true; if (STAT(FROZEN, player)) return true; @@ -472,6 +472,8 @@ void W_WeaponFrame(Player actor, .entity weaponentity) if (this.m_switchweapon == WEP_Null) { + if (this.state != WS_CLEAR) + w_ready(this.m_weapon, actor, weaponentity, button_atck | (button_atck2 << 1)); this.m_weapon = WEP_Null; this.m_switchingweapon = WEP_Null; this.state = WS_CLEAR; @@ -557,7 +559,7 @@ void W_WeaponFrame(Player actor, .entity weaponentity) // server framerate is very low and the weapon fire rate very high for (int c = 0; c < W_TICSPERFRAME; ++c) { - if (w != WEP_Null && !(actor.weapons & WepSet_FromWeapon(w))) + if (w != WEP_Null && !(STAT(WEAPONS, actor) & WepSet_FromWeapon(w))) { if (this.m_weapon == this.m_switchweapon) W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity); w = WEP_Null; @@ -574,7 +576,7 @@ void W_WeaponFrame(Player actor, .entity weaponentity) key_pressed = false; Weapon off = actor.offhand; - if (off && !(actor.weapons & WEPSET(HOOK))) + if (off && (!(STAT(WEAPONS, actor) & WEPSET(HOOK)) || off != OFFHAND_HOOK)) { if (off.offhand_think) off.offhand_think(off, actor, key_pressed); } @@ -658,9 +660,11 @@ void W_AttachToShotorg(entity actor, .entity weaponentity, entity flash, vector void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use, .entity weaponentity) { - if (MUTATOR_CALLHOOK(W_DecreaseAmmo, actor, actor.(weaponentity))) return; + if (MUTATOR_CALLHOOK(W_DecreaseAmmo, actor, actor.(weaponentity), ammo_use)) return; if ((actor.items & IT_UNLIMITED_WEAPON_AMMO) && !wep.reloading_ammo) return; + ammo_use = M_ARGV(2, float); + entity w_ent = actor.(weaponentity); // if this weapon is reloadable, decrease its load. Else decrease the player's ammo @@ -739,8 +743,7 @@ void W_Reload(entity actor, .entity weaponentity, float sent_ammo_min, Sound sen this.reload_ammo_min = sent_ammo_min; this.reload_ammo_amount = e.reloading_ammo; this.reload_time = e.reloading_time; - if (actor.reload_sound) strunzone(actor.reload_sound); - actor.reload_sound = strzone(Sound_fixpath(sent_sound)); + strcpy(actor.reload_sound, Sound_fixpath(sent_sound)); // don't reload weapons that don't have the RELOADABLE flag if (!(e.spawnflags & WEP_FLAG_RELOADABLE))