X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fweapon%2Fhlac.qc;h=928462a204e697c7e73c0274724eaa067488cf5c;hb=fd20a1f1eae2b2ba955ce9ddedc20cd151a6f362;hp=932f3d17da42f6830c169fbda0b7952bcd1b95a9;hpb=537313c9e52ce93b28ad6580b76e92d99f0a9d93;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/weapon/hlac.qc b/qcsrc/common/weapons/weapon/hlac.qc index 932f3d17d..928462a20 100644 --- a/qcsrc/common/weapons/weapon/hlac.qc +++ b/qcsrc/common/weapons/weapon/hlac.qc @@ -54,8 +54,8 @@ REGISTER_WEAPON(HLAC, hlac, NEW(HLAC)); #ifdef SVQC spawnfunc(weapon_hlac) { weapon_defaultspawnfunc(this, WEP_HLAC); } -void W_HLAC_Touch() -{SELFPARAM(); +void W_HLAC_Touch(entity this) +{ float isprimary; PROJECTILE_TOUCH; @@ -69,8 +69,8 @@ void W_HLAC_Touch() remove(self); } -void W_HLAC_Attack(Weapon thiswep) -{SELFPARAM(); +void W_HLAC_Attack(Weapon thiswep, entity actor) +{entity this = actor; entity missile; float spread; @@ -104,8 +104,8 @@ void W_HLAC_Attack(Weapon thiswep) W_SetupProjVelocity_Basic(missile, WEP_CVAR_PRI(hlac, speed), spread); //missile.angles = vectoangles(missile.velocity); // csqc - missile.touch = W_HLAC_Touch; - missile.think = SUB_Remove_self; + settouch(missile, W_HLAC_Touch); + setthink(missile, SUB_Remove); missile.nextthink = time + WEP_CVAR_PRI(hlac, lifetime); @@ -117,8 +117,8 @@ void W_HLAC_Attack(Weapon thiswep) MUTATOR_CALLHOOK(EditProjectile, self, missile); } -void W_HLAC_Attack2() -{SELFPARAM(); +void W_HLAC_Attack2(entity actor) +{entity this = actor; entity missile; float spread; @@ -146,8 +146,8 @@ void W_HLAC_Attack2() W_SetupProjVelocity_Basic(missile, WEP_CVAR_SEC(hlac, speed), spread); //missile.angles = vectoangles(missile.velocity); // csqc - missile.touch = W_HLAC_Touch; - missile.think = SUB_Remove_self; + settouch(missile, W_HLAC_Touch); + setthink(missile, SUB_Remove); missile.nextthink = time + WEP_CVAR_SEC(hlac, lifetime); @@ -181,7 +181,7 @@ void W_HLAC_Attack_Frame(Weapon thiswep, entity actor, .entity weaponentity, int int slot = weaponslot(weaponentity); ATTACK_FINISHED(actor, slot) = time + WEP_CVAR_PRI(hlac, refire) * W_WeaponRateFactor(); - W_HLAC_Attack(WEP_HLAC); + W_HLAC_Attack(WEP_HLAC, actor); actor.misc_bulletcounter = actor.misc_bulletcounter + 1; weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(hlac, refire), W_HLAC_Attack_Frame); } @@ -191,14 +191,14 @@ void W_HLAC_Attack_Frame(Weapon thiswep, entity actor, .entity weaponentity, int } } -void W_HLAC_Attack2_Frame(Weapon thiswep) -{SELFPARAM(); +void W_HLAC_Attack2_Frame(Weapon thiswep, entity actor) +{entity this = actor; float i; W_DecreaseAmmo(thiswep, self, WEP_CVAR_SEC(hlac, ammo)); for(i=WEP_CVAR_SEC(hlac, shots);i>0;--i) - W_HLAC_Attack2(); + W_HLAC_Attack2(actor); if(!autocvar_g_norecoil) { @@ -207,9 +207,9 @@ void W_HLAC_Attack2_Frame(Weapon thiswep) } } -METHOD(HLAC, wr_aim, void(entity thiswep)) +METHOD(HLAC, wr_aim, void(entity thiswep, entity actor)) { - SELFPARAM(); + entity this = actor; PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, WEP_CVAR_PRI(hlac, speed), 0, WEP_CVAR_PRI(hlac, lifetime), false); } METHOD(HLAC, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) @@ -221,7 +221,7 @@ METHOD(HLAC, wr_think, void(entity thiswep, entity actor, .entity weaponentity, if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(hlac, refire))) { actor.misc_bulletcounter = 0; - W_HLAC_Attack(thiswep); + W_HLAC_Attack(thiswep, actor); weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(hlac, refire), W_HLAC_Attack_Frame); } } @@ -230,7 +230,7 @@ METHOD(HLAC, wr_think, void(entity thiswep, entity actor, .entity weaponentity, { if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(hlac, refire))) { - W_HLAC_Attack2_Frame(thiswep); + W_HLAC_Attack2_Frame(thiswep, actor); weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(hlac, animtime), w_ready); } } @@ -249,8 +249,7 @@ METHOD(HLAC, wr_checkammo2, bool(entity thiswep, entity actor)) } METHOD(HLAC, wr_reload, void(entity thiswep, entity actor, .entity weaponentity)) { - SELFPARAM(); - W_Reload(self, min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo)), SND_RELOAD); + W_Reload(actor, min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo)), SND_RELOAD); } METHOD(HLAC, wr_suicidemessage, Notification(entity thiswep)) { @@ -264,9 +263,9 @@ METHOD(HLAC, wr_killmessage, Notification(entity thiswep)) #endif #ifdef CSQC -METHOD(HLAC, wr_impacteffect, void(entity thiswep)) +METHOD(HLAC, wr_impacteffect, void(entity thiswep, entity actor)) { - SELFPARAM(); + entity this = actor; vector org2; org2 = w_org + w_backoff * 6; pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);