#include "cl_impulse.qh"
#include "round_handler.qh"
-#include "bot/waypoints.qh"
+#include "bot/api.qh"
#include "weapons/throwing.qh"
#include "command/common.qh"
#include "cheats.qh"
-#include "bot/navigation.qh"
#include "weapons/selection.qh"
#include "weapons/tracing.qh"
#include "weapons/weaponsystem.qh"
{
if (this.vehicle) return;
if (IS_DEAD(this)) return;
- W_ThrowWeapon(this, W_CalculateProjectileVelocity(this, this.velocity, v_forward * 750, false), '0 0 0', true);
+ W_ThrowWeapon(this, weaponentities[0], W_CalculateProjectileVelocity(this, this.velocity, v_forward * 750, false), '0 0 0', true);
}
IMPULSE(weapon_reload)
if (forbidWeaponUse(this)) return;
Weapon w = PS(this).m_weapon;
entity actor = this;
- .entity weaponentity = weaponentities[0]; // TODO: unhardcode
- w.wr_reload(w, actor, weaponentity);
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ {
+ .entity weaponentity = weaponentities[slot];
+ w.wr_reload(w, actor, weaponentity);
+ }
}
void ImpulseCommands(entity this)
WaypointSprite_ClearPersonal(this);
if (this.personal)
{
- remove(this.personal);
+ delete(this.personal);
this.personal = NULL;
}
sprint(this, "personal waypoint cleared\n");
WaypointSprite_ClearOwned(this);
if (this.personal)
{
- remove(this.personal);
+ delete(this.personal);
this.personal = NULL;
}
sprint(this, "all waypoints cleared\n");
IMPULSE(navwaypoint_unreachable)
{
if (!autocvar_g_waypointeditor) return;
- FOREACH_ENTITY_CLASS("waypoint", true,
+ IL_EACH(g_waypoints, true,
{
it.colormod = '0.5 0.5 0.5';
it.effects &= ~(EF_NODEPTHTEST | EF_RED | EF_BLUE);
j = 0;
m = 0;
- FOREACH_ENTITY_CLASS("waypoint", it.wpcost >= 10000000,
+ IL_EACH(g_waypoints, it.wpcost >= 10000000,
{
LOG_INFO("unreachable: ", etos(it), " ", vtos(it.origin), "\n");
it.colormod_z = 8;
navigation_markroutes_inverted(e2);
j = 0;
- FOREACH_ENTITY_CLASS("waypoint", it.wpcost >= 10000000,
+ IL_EACH(g_waypoints, it.wpcost >= 10000000,
{
LOG_INFO("cannot reach me: ", etos(it), " ", vtos(it.origin), "\n");
it.colormod_x = 8;