From: Mario Date: Fri, 21 Oct 2016 01:27:13 +0000 (+1000) Subject: Merge branch 'master' into Mario/wepent_experimental X-Git-Tag: xonotic-v0.8.2~326^2~37 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=cc37ae9ec08cca9f8b17cdbf91e71380d0d6f700 Merge branch 'master' into Mario/wepent_experimental # Conflicts: # qcsrc/common/weapons/weapon/hagar.qc # qcsrc/common/weapons/weapon/tuba.qc --- cc37ae9ec08cca9f8b17cdbf91e71380d0d6f700 diff --cc qcsrc/common/monsters/monster.qh index 8540d5cc2,2685e2fbc..5572fe910 --- a/qcsrc/common/monsters/monster.qh +++ b/qcsrc/common/monsters/monster.qh @@@ -1,19 -1,20 +1,20 @@@ #pragma once // special spawn flags - const int MONSTER_RESPAWN_DEATHPOINT = 16; // re-spawn where we died - const int MONSTER_TYPE_FLY = 32; - const int MONSTER_TYPE_SWIM = 64; - const int MONSTER_SIZE_BROKEN = 128; // TODO: remove when bad models are replaced - const int MON_FLAG_SUPERMONSTER = 256; // incredibly powerful monster - const int MON_FLAG_RANGED = 512; // monster shoots projectiles - const int MON_FLAG_MELEE = 1024; - const int MON_FLAG_CRUSH = 2048; // monster can be stomped in special modes - const int MON_FLAG_RIDE = 4096; // monster can be ridden in special modes - const int MONSTER_SIZE_QUAKE = 8192; + const int MONSTER_RESPAWN_DEATHPOINT = BIT(4); // re-spawn where we died + const int MONSTER_TYPE_FLY = BIT(5); + const int MONSTER_TYPE_SWIM = BIT(6); + const int MONSTER_SIZE_BROKEN = BIT(7); // TODO: remove when bad models are replaced + const int MON_FLAG_SUPERMONSTER = BIT(8); // incredibly powerful monster + const int MON_FLAG_RANGED = BIT(9); // monster shoots projectiles + const int MON_FLAG_MELEE = BIT(10); + const int MON_FLAG_CRUSH = BIT(11); // monster can be stomped in special modes + const int MON_FLAG_RIDE = BIT(12); // monster can be ridden in special modes + const int MONSTER_SIZE_QUAKE = BIT(13); + const int MONSTER_TYPE_PASSIVE = BIT(14); // doesn't target or chase enemies // entity properties of monsterinfo: -.bool(int, entity actor, entity targ) monster_attackfunc; +.bool(int, entity actor, entity targ, .entity weaponentity) monster_attackfunc; // animations .vector anim_blockend; diff --cc qcsrc/common/weapons/weapon/arc.qc index 3d011345b,576976357..89a87433b --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@@ -341,6 -340,8 +341,8 @@@ void W_Arc_Beam_Think(entity this || forbidWeaponUse(this.owner) || - PS(this.owner).m_switchweapon != WEP_ARC ++ this.owner.(weaponentity).m_switchweapon != WEP_ARC + || (!PHYS_INPUT_BUTTON_ATCK(this.owner) && !burst ) || this.owner.vehicle diff --cc qcsrc/common/weapons/weapon/hagar.qc index cb4d365ad,097f2bfdc..96479d1ab --- a/qcsrc/common/weapons/weapon/hagar.qc +++ b/qcsrc/common/weapons/weapon/hagar.qc @@@ -313,10 -310,10 +313,10 @@@ void W_Hagar_Attack2_Load(Weapon thiswe { // loadable hagar secondary attack, must always run each frame - if(time < game_starttime) + if(time < game_starttime || PS(actor).m_switchweapon != WEP_HAGAR) return; - bool loaded = actor.hagar_load >= WEP_CVAR_SEC(hagar, load_max); + bool loaded = actor.(weaponentity).hagar_load >= WEP_CVAR_SEC(hagar, load_max); // this is different than WR_CHECKAMMO when it comes to reloading bool enough_ammo; @@@ -421,7 -416,7 +421,7 @@@ void W_Hagar_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity, int fire) { - if(!(fire & 1) || actor.(weaponentity).hagar_load || actor.(weaponentity).hagar_loadblock) - if(!(fire & 1) || actor.hagar_load || actor.hagar_loadblock || PS(actor).m_switchweapon != WEP_HAGAR) ++ if(!(fire & 1) || actor.(weaponentity).hagar_load || actor.(weaponentity).hagar_loadblock || actor.(weaponentity).m_switchweapon != WEP_HAGAR) { w_ready(thiswep, actor, weaponentity, fire); return; diff --cc qcsrc/common/weapons/weapon/tuba.qc index 1c6948c39,7f1bce0ac..d68de4a35 --- a/qcsrc/common/weapons/weapon/tuba.qc +++ b/qcsrc/common/weapons/weapon/tuba.qc @@@ -398,19 -396,40 +398,11 @@@ METHOD(Tuba, wr_think, void(Tuba this, } } -METHOD(Tuba, wr_setup, void(Tuba this, entity actor)) +METHOD(Tuba, wr_setup, void(Tuba this, entity actor, .entity weaponentity)) { - actor.ammo_field = ammo_none; - actor.tuba_instrument = 0; + actor.(weaponentity).tuba_instrument = 0; } -#endif -REGISTER_NET_S2C(tuba_instrument) -#ifdef CSQC -NET_HANDLE(tuba_instrument, bool) -{ - int i = ReadByte(); - return = true; - string s = (i == 0) ? "tuba" : - (i == 1) ? "akordeon" : - "kleinbottle" ; - CL_WeaponEntity_SetModel(viewmodel, s, true); -} -#endif -#ifdef SVQC -void tuba_instrument_send(entity this, int instr) -{ - msg_entity = this; - if (!IS_REAL_CLIENT(this)) - return; - int chan = MSG_ONE; - WriteHeader(chan, tuba_instrument); - WriteByte(chan, instr); -} --SPECTATE_COPY() --{ - for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) - { - .entity weaponentity = weaponentities[slot]; - this.(weaponentity).tuba_instrument = spectatee.(weaponentity).tuba_instrument; - } - if (this.tuba_instrument != spectatee.tuba_instrument) - tuba_instrument_send(this, this.tuba_instrument = spectatee.tuba_instrument); --} METHOD(Tuba, wr_reload, void(Tuba this, entity actor, .entity weaponentity)) { // switch to alternate instruments :)