X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fweapon%2Fporto.qc;h=8a689e05109086704ecf726a751aafea27463aee;hb=65e9ceb03c81bc515d090a54f65dd620c8c6dc43;hp=dbcad2c1e6d8e177666ebfb0b40e9141ba2f13a9;hpb=f2a7c3c0c62985e64a71b475c55bc974d28e0805;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/weapon/porto.qc b/qcsrc/common/weapons/weapon/porto.qc index dbcad2c1e..8a689e051 100644 --- a/qcsrc/common/weapons/weapon/porto.qc +++ b/qcsrc/common/weapons/weapon/porto.qc @@ -1,12 +1,13 @@ +#include "porto.qh" #ifndef IMPLEMENTATION CLASS(PortoLaunch, Weapon) -/* ammotype */ ATTRIB(PortoLaunch, ammo_field, .int, ammo_none) -/* impulse */ ATTRIB(PortoLaunch, impulse, int, 0) +/* ammotype */ ATTRIB(PortoLaunch, ammo_field, .int, ammo_none); +/* impulse */ ATTRIB(PortoLaunch, impulse, int, 0); /* flags */ ATTRIB(PortoLaunch, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_SUPERWEAPON); /* rating */ ATTRIB(PortoLaunch, bot_pickupbasevalue, float, 0); /* color */ ATTRIB(PortoLaunch, wpcolor, vector, '0.5 0.5 0.5'); /* modelname */ ATTRIB(PortoLaunch, mdl, string, "porto"); -#ifndef MENUQC +#ifdef GAMEQC /* model */ ATTRIB(PortoLaunch, m_model, Model, MDL_PORTO_ITEM); #endif /* crosshair */ ATTRIB(PortoLaunch, w_crosshair, string, "gfx/crosshairporto"); @@ -62,7 +63,7 @@ void W_Porto_Success(entity this) } this.realowner.porto_current = NULL; - remove(this); + delete(this); } string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vector velo); @@ -98,7 +99,7 @@ void W_Porto_Fail(entity this, float failhard) } } } - remove(this); + delete(this); } void W_Porto_Remove(entity p) @@ -113,7 +114,7 @@ void W_Porto_Think(entity this) { trace_plane_normal = '0 0 0'; if(this.realowner.playerid != this.playerid) - remove(this); + delete(this); else W_Porto_Fail(this, 0); } @@ -143,7 +144,7 @@ void W_Porto_Touch(entity this, entity toucher) if(this.realowner.playerid != this.playerid) { sound(this, CH_SHOTS, SND_PORTO_UNSUPPORTED, VOL_BASE, ATTEN_NORM); - remove(this); + delete(this); } else if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK || trace_dphitcontents & DPCONTENTS_PLAYERCLIP) { @@ -240,11 +241,11 @@ void W_Porto_Touch(entity this, entity toucher) } } -void W_Porto_Attack(entity actor, float type) +void W_Porto_Attack(entity actor, .entity weaponentity, float type) { entity gren; - W_SetupShot(actor, false, 4, SND_PORTO_FIRE, CH_WEAPON_A, 0); + W_SetupShot(actor, weaponentity, false, 4, SND_PORTO_FIRE, CH_WEAPON_A, 0); // always shoot from the eye w_shotdir = v_forward; w_shotorg = actor.origin + actor.view_ofs + ((w_shotorg - actor.origin - actor.view_ofs) * v_forward) * v_forward; @@ -257,7 +258,7 @@ void W_Porto_Attack(entity actor, float type) gren.playerid = actor.playerid; gren.bot_dodge = true; gren.bot_dodgerating = 200; - gren.movetype = MOVETYPE_BOUNCEMISSILE; + set_movetype(gren, MOVETYPE_BOUNCEMISSILE); PROJECTILE_MAKETRIGGER(gren); gren.effects = EF_RED; gren.scale = 4; @@ -275,6 +276,7 @@ void W_Porto_Attack(entity actor, float type) gren.angles = vectoangles(gren.velocity); gren.flags = FL_PROJECTILE; + IL_PUSH(g_projectiles, gren); gren.portal_id = time; actor.porto_current = gren; @@ -309,7 +311,7 @@ METHOD(PortoLaunch, wr_think, void(entity thiswep, entity actor, .entity weapone if(!actor.porto_forbidden) if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(porto, refire))) { - W_Porto_Attack(actor, 0); + W_Porto_Attack(actor, weaponentity, 0); weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(porto, animtime), w_ready); } @@ -318,7 +320,7 @@ METHOD(PortoLaunch, wr_think, void(entity thiswep, entity actor, .entity weapone if(!actor.porto_forbidden) if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(porto, refire))) { - W_Porto_Attack(actor, 1); + W_Porto_Attack(actor, weaponentity, 1); weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(porto, animtime), w_ready); } } @@ -351,7 +353,7 @@ METHOD(PortoLaunch, wr_think, void(entity thiswep, entity actor, .entity weapone if(!actor.porto_forbidden) if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(porto, refire))) { - W_Porto_Attack(actor, -1); + W_Porto_Attack(actor, weaponentity, -1); weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(porto, animtime), w_ready); } } @@ -377,7 +379,7 @@ METHOD(PortoLaunch, wr_resetplayer, void(entity thiswep, entity actor)) #endif #ifdef CSQC METHOD(PortoLaunch, wr_impacteffect, void(entity this, entity actor)) { - LOG_WARNING("Since when does Porto send DamageInfo?\n"); + LOG_WARN("Since when does Porto send DamageInfo?"); } #endif #endif