- METHOD(PortoLaunch, wr_aim, void(entity thiswep))
- {
- SELFPARAM();
- self.BUTTON_ATCK = false;
- self.BUTTON_ATCK2 = false;
- if(!WEP_CVAR(porto, secondary))
- if(bot_aim(WEP_CVAR_PRI(porto, speed), 0, WEP_CVAR_PRI(porto, lifetime), false))
- self.BUTTON_ATCK = true;
- }
- METHOD(PortoLaunch, wr_config, void(entity this))
- {
- PORTO_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
- }
- METHOD(PortoLaunch, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
- {
- if(WEP_CVAR(porto, secondary))
- {
- if(fire & 1)
- if(!actor.porto_current)
- if(!actor.porto_forbidden)
- if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(porto, refire)))
- {
- W_Porto_Attack(0);
- weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(porto, animtime), w_ready);
- }
-
- if(fire & 2)
- if(!actor.porto_current)
- if(!actor.porto_forbidden)
- if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(porto, refire)))
- {
- W_Porto_Attack(1);
- weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(porto, animtime), w_ready);
- }
- }
- else
- {
- if(actor.porto_v_angle_held)
- {
- if(!(fire & 2))
- {
- actor.porto_v_angle_held = 0;
-
- ClientData_Touch(actor);
- }
- }
- else
- {
- if(fire & 2)
- {
- actor.porto_v_angle = actor.v_angle;
- actor.porto_v_angle_held = 1;
-
- ClientData_Touch(actor);
- }
- }
- if(actor.porto_v_angle_held)
- makevectors(actor.porto_v_angle); // override the previously set angles
-
- if(fire & 1)
- if(!actor.porto_current)
- if(!actor.porto_forbidden)
- if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(porto, refire)))
- {
- W_Porto_Attack(-1);
- weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(porto, animtime), w_ready);
- }
- }
- }
- METHOD(PortoLaunch, wr_checkammo1, bool(entity this))
- {
- // always allow infinite ammo
- return true;
- }
- METHOD(PortoLaunch, wr_checkammo2, bool(entity this))
- {
- // always allow infinite ammo
- return true;
- }
- METHOD(PortoLaunch, wr_init, void(entity this))
- {
- PORTO_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
- }
- METHOD(PortoLaunch, wr_setup, void(entity thiswep))
- {
- SELFPARAM();
- self.ammo_field = ammo_none;
- }
- METHOD(PortoLaunch, wr_resetplayer, void(entity thiswep))
- {
- SELFPARAM();
- self.porto_current = world;
- }
+METHOD(PortoLaunch, wr_aim, void(entity thiswep, entity actor))
+{
+ PHYS_INPUT_BUTTON_ATCK(actor) = false;
+ PHYS_INPUT_BUTTON_ATCK2(actor) = false;
+ if(!WEP_CVAR(porto, secondary))
+ if(bot_aim(actor, WEP_CVAR_PRI(porto, speed), 0, WEP_CVAR_PRI(porto, lifetime), false))
+ PHYS_INPUT_BUTTON_ATCK(actor) = true;
+}
+METHOD(PortoLaunch, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
+{
+ if(WEP_CVAR(porto, secondary))
+ {
+ if(fire & 1)
+ if(!actor.porto_current)
+ if(!actor.porto_forbidden)
+ if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(porto, refire)))
+ {
+ W_Porto_Attack(actor, weaponentity, 0);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(porto, animtime), w_ready);
+ }
+
+ if(fire & 2)
+ if(!actor.porto_current)
+ if(!actor.porto_forbidden)
+ if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(porto, refire)))
+ {
+ W_Porto_Attack(actor, weaponentity, 1);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(porto, animtime), w_ready);
+ }
+ }
+ else
+ {
+ if(actor.porto_v_angle_held)
+ {
+ if(!(fire & 2))
+ {
+ actor.porto_v_angle_held = 0;
+
+ ClientData_Touch(actor);
+ }
+ }
+ else
+ {
+ if(fire & 2)
+ {
+ actor.porto_v_angle = actor.v_angle;
+ actor.porto_v_angle_held = 1;
+
+ ClientData_Touch(actor);
+ }
+ }
+ if(actor.porto_v_angle_held)
+ makevectors(actor.porto_v_angle); // override the previously set angles
+
+ if(fire & 1)
+ if(!actor.porto_current)
+ if(!actor.porto_forbidden)
+ if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(porto, refire)))
+ {
+ W_Porto_Attack(actor, weaponentity, -1);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(porto, animtime), w_ready);
+ }
+ }
+}
+METHOD(PortoLaunch, wr_checkammo1, bool(entity thiswep, entity this))
+{
+ // always allow infinite ammo
+ return true;
+}
+METHOD(PortoLaunch, wr_checkammo2, bool(entity thiswep, entity this))
+{
+ // always allow infinite ammo
+ return true;
+}
+METHOD(PortoLaunch, wr_setup, void(entity thiswep, entity actor))
+{
+ actor.ammo_field = ammo_none;
+}
+METHOD(PortoLaunch, wr_resetplayer, void(entity thiswep, entity actor))
+{
+ actor.porto_current = NULL;
+}