X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fweapon%2Felectro.qc;h=46e46c24059660e8fd3b30b7ffe37da13d704d9d;hb=87bec07409c336c956a798556064c6819ad40a4d;hp=15387a90581141b6bb23d82fda7c6a280bae8903;hpb=4d01c64254bd9726c345afe727b70749879c04f6;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index 15387a905..46e46c240 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -332,6 +332,7 @@ void W_Electro_Orb_Stick(entity this, entity to) newproj.event_damage = this.event_damage; newproj.spawnshieldtime = this.spawnshieldtime; newproj.damagedbycontents = true; + IL_PUSH(g_damagedbycontents, newproj); set_movetype(newproj, MOVETYPE_NONE); // lock the orb in place newproj.projectiledeathtype = this.projectiledeathtype; @@ -453,6 +454,8 @@ void W_Electro_Attack_Orb(Weapon thiswep, entity actor, .entity weaponentity) IL_PUSH(g_projectiles, proj); IL_PUSH(g_bot_dodge, proj); proj.damagedbycontents = (WEP_CVAR_SEC(electro, damagedbycontents)); + if(proj.damagedbycontents) + IL_PUSH(g_damagedbycontents, proj); proj.bouncefactor = WEP_CVAR_SEC(electro, bouncefactor); proj.bouncestop = WEP_CVAR_SEC(electro, bouncestop); @@ -488,7 +491,7 @@ void W_Electro_CheckAttack(Weapon thiswep, entity actor, .entity weaponentity, i .float bot_secondary_electromooth; -METHOD(Electro, wr_aim, void(entity thiswep, entity actor)) +METHOD(Electro, wr_aim, void(entity thiswep, entity actor, .entity weaponentity)) { PHYS_INPUT_BUTTON_ATCK(actor) = PHYS_INPUT_BUTTON_ATCK2(actor) = false; if(vdist(actor.origin - actor.enemy.origin, >, 1000)) { actor.bot_secondary_electromooth = 0; } @@ -497,9 +500,9 @@ METHOD(Electro, wr_aim, void(entity thiswep, entity actor)) float shoot; if(WEP_CVAR_PRI(electro, speed)) - shoot = bot_aim(actor, WEP_CVAR_PRI(electro, speed), 0, WEP_CVAR_PRI(electro, lifetime), false); + shoot = bot_aim(actor, weaponentity, WEP_CVAR_PRI(electro, speed), 0, WEP_CVAR_PRI(electro, lifetime), false); else - shoot = bot_aim(actor, 1000000, 0, 0.001, false); + shoot = bot_aim(actor, weaponentity, 1000000, 0, 0.001, false); if(shoot) { @@ -509,7 +512,7 @@ METHOD(Electro, wr_aim, void(entity thiswep, entity actor)) } else { - if(bot_aim(actor, WEP_CVAR_SEC(electro, speed), WEP_CVAR_SEC(electro, speed_up), WEP_CVAR_SEC(electro, lifetime), true)) + if(bot_aim(actor, weaponentity, WEP_CVAR_SEC(electro, speed), WEP_CVAR_SEC(electro, speed_up), WEP_CVAR_SEC(electro, lifetime), true)) { PHYS_INPUT_BUTTON_ATCK2(actor) = true; if(random() < 0.03) actor.bot_secondary_electromooth = 0;