trigger weaponswitch for others (issue #257)
This commit is contained in:
@@ -944,7 +944,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p, bool demo = false)
|
||||
case SV_WEAPCHANGE:
|
||||
{
|
||||
int gun = getint(p);
|
||||
if(d) d->selectweapon(gun);
|
||||
if(d) d->selectweapon(gun,d!=player1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+8
-1
@@ -534,7 +534,14 @@ public:
|
||||
curskin = nextskin[team_base(team)];
|
||||
}
|
||||
|
||||
void selectweapon(int w) { if (weaponsel) prevweaponsel = weaponsel; weaponsel = weapons[(gunselect = w)]; if (!prevweaponsel) prevweaponsel = weaponsel; }
|
||||
void selectweapon(int w, bool other = false)
|
||||
{
|
||||
if(weaponsel) prevweaponsel = weaponsel;
|
||||
weaponsel = weapons[(gunselect = w)];
|
||||
if(!prevweaponsel) prevweaponsel = weaponsel;
|
||||
if(other && (prevweaponsel != weaponsel)) weaponswitch(weaponsel, true);
|
||||
}
|
||||
|
||||
void setprimary(int w) { primweap = weapons[(primary = w)]; }
|
||||
void setnextprimary(int w) { nextprimweap = weapons[(nextprimary = w)]; }
|
||||
bool isspectating() { return state==CS_SPECTATE || (state==CS_DEAD && spectatemode > SM_NONE); }
|
||||
|
||||
@@ -1510,8 +1510,8 @@ int sniperrifle::dynspread()
|
||||
float sniperrifle::dynrecoil() { return scoped && lastmillis - scoped_since > SCOPESETTLETIME ? info.recoil / 3 : info.recoil; }
|
||||
bool sniperrifle::selectable() { return weapon::selectable() && !m_noprimary && this == owner->primweap; }
|
||||
void sniperrifle::onselecting(bool sound) { weapon::onselecting(sound); scoped = false; player1->scoping = false; }
|
||||
void sniperrifle::ondeselecting() { scoped = false; player1->scoping = false; }
|
||||
void sniperrifle::onownerdies() { scoped = false; player1->scoping = false; shots = 0; }
|
||||
void sniperrifle::ondeselecting() { scoped = false; owner->scoping = false; }
|
||||
void sniperrifle::onownerdies() { shots = 0; scoped = false; owner->scoping = false; }
|
||||
void sniperrifle::renderhudmodel() { if(!scoped) weapon::renderhudmodel(); }
|
||||
|
||||
void sniperrifle::renderaimhelp(bool teamwarning)
|
||||
@@ -1577,7 +1577,7 @@ void akimbo::onammopicked()
|
||||
if(akimboautoswitch || owner->weaponsel->type==GUN_PISTOL)
|
||||
{
|
||||
if(player1->weapons[GUN_GRENADE]->busy()) player1->attacking = false;
|
||||
owner->weaponswitch(this);
|
||||
player1->weaponswitch(this);
|
||||
}
|
||||
addmsg(SV_AKIMBO, "ri", lastmillis);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user