X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fimpulse.qc;h=ee26d65a794056fb78d445ab327ca879214be60b;hb=14b59af2805e480ceaca156ce7f0b16dcadc6ed7;hp=9b1e38e8e376c381f096b3c6c0f07527a30d5682;hpb=9e50112561ad6f4cefe6d13bd7185f5dfd1ada4b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/impulse.qc b/qcsrc/server/impulse.qc index 9b1e38e8e..ee26d65a7 100644 --- a/qcsrc/server/impulse.qc +++ b/qcsrc/server/impulse.qc @@ -9,6 +9,8 @@ #include "weapons/tracing.qh" #include "weapons/weaponsystem.qh" +#include + #include #include "../common/minigames/sv_minigames.qh" @@ -149,7 +151,7 @@ X(9, next) for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) \ { \ .entity weaponentity = weaponentities[slot]; \ - W_SwitchWeapon_TryOthers(this, Weapons_from(WEP_FIRST + i), weaponentity); \ + W_SwitchWeapon_TryOthers(this, REGISTRY_GET(Weapons, WEP_FIRST + i), weaponentity); \ if(autocvar_g_weaponswitch_debug != 1) \ break; \ } \ @@ -320,13 +322,19 @@ IMPULSE(weapon_drop) { if (this.vehicle) return; if (IS_DEAD(this)) return; + bool is_dualwielding = W_DualWielding(this); for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) { .entity weaponentity = weaponentities[slot]; - W_ThrowWeapon(this, weaponentity, W_CalculateProjectileVelocity(this, this.velocity, v_forward * 750, false), '0 0 0', true); - - if(autocvar_g_weaponswitch_debug != 1) - break; + vector md = this.(weaponentity).movedir; + vector vecs = ((md.x > 0) ? md : '0 0 0'); + vector dv = v_right * -vecs.y; + if(!is_dualwielding) + dv = '0 0 0'; // don't override! + W_ThrowWeapon(this, weaponentity, W_CalculateProjectileVelocity(this, this.velocity, v_forward * 750, false), dv, true); + + if(autocvar_g_weaponswitch_debug == 2) + break; // in this mode, the off-hand weapon is selected based on the primary weapon, don't drop it twice! } } @@ -334,7 +342,7 @@ IMPULSE(weapon_reload) { if (this.vehicle) return; if (IS_DEAD(this)) return; - if (forbidWeaponUse(this)) return; + if (weaponLocked(this)) return; entity actor = this; for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) { @@ -507,7 +515,7 @@ IMPULSE(waypoint_here_here) IMPULSE(waypoint_here_crosshair) { - WarpZone_crosshair_trace(this); + WarpZone_crosshair_trace_plusvisibletriggers(this); entity wp = WaypointSprite_DeployFixed(WP_Here, false, this, trace_endpos, RADARICON_HERE); if (wp) WaypointSprite_Ping(wp); sprint(this, "HERE spawned at crosshair\n");