void CheatInit()
{
- gamestart_sv_cheats = cvar("sv_cheats");
+ gamestart_sv_cheats = autocvar_sv_cheats;
}
void CheatShutdown()
self.health = start_health;
self.armorvalue = start_armorvalue;
self.weapons |= weaponsInMap;
- self.pauserotarmor_finished = time + cvar("g_balance_pause_armor_rot_spawn");
- self.pauserothealth_finished = time + cvar("g_balance_pause_health_rot_spawn");
- self.pauserotfuel_finished = time + cvar("g_balance_pause_fuel_rot_spawn");
- self.pauseregen_finished = time + cvar("g_balance_pause_health_regen_spawn");
+ self.pauserotarmor_finished = time + autocvar_g_balance_pause_armor_rot_spawn;
+ self.pauserothealth_finished = time + autocvar_g_balance_pause_health_rot_spawn;
+ self.pauserotfuel_finished = time + autocvar_g_balance_pause_fuel_rot_spawn;
+ self.pauseregen_finished = time + autocvar_g_balance_pause_health_regen_spawn;
self.strength_finished = 0;
self.invincible_finished = 0;
}
e2 = spawn();
setorigin(e2, org);
pointparticles(particleeffectnum("rocket_explode"), org, '0 0 0', 1);
- sound(e2, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(e2, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
RadiusDamage(e2, e, 1000, 0, 128, e, 500, DEATH_CHEAT, world);
remove(e2);
}
// arguments:
// effectname
effectnum = particleeffectnum(argv(1));
- W_SetupShot(self, FALSE, FALSE, "", CHAN_WEAPON, 0);
+ W_SetupShot(self, FALSE, FALSE, "", CH_WEAPON_A, 0);
traceline(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, MOVE_NORMAL, self);
trailparticles(self, effectnum, w_shotorg, trace_endpos);
DID_CHEAT();
// arguments:
// modelname mode
f = stof(argv(2));
- W_SetupShot(self, FALSE, FALSE, "", CHAN_WEAPON, 0);
+ W_SetupShot(self, FALSE, FALSE, "", CH_WEAPON_A, 0);
traceline(w_shotorg, w_shotorg + w_shotdir * 2048, MOVE_NORMAL, self);
if((trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) || trace_fraction == 1)
{
remove(e);
DID_CHEAT();
break;
- case "warp":
- IS_CHEAT(0, argc, 0);
- if(argc == 2) if(cvar("g_campaign"))
- {
- CampaignLevelWarp(stof(argv(1)));
- DID_CHEAT();
- }
- break;
case "god":
IS_CHEAT(0, argc, 0);
BITXOR_ASSIGN(self.flags, FL_GODMODE);
END_CHEAT_FUNCTION();
}
-void crosshair_trace_plusvisibletriggers(entity pl);
+float Drag(entity e, float candrag);
void Drag_Begin(entity dragger, entity draggee, vector touchpoint);
void Drag_Finish(entity dragger);
float Drag_IsDraggable(entity draggee);
{
BEGIN_CHEAT_FUNCTION();
+ switch(0)
+ {
+ default:
+ if(self.BUTTON_DRAG && !cvar("g_sandbox"))
+ {
+ // consider dragging a cheat only if sandbox mode is disabled
+ IS_CHEAT(0, 0, CHRAME_DRAG);
+ }
+ if(autocvar_sv_cheats)
+ {
+ // only use cheat dragging if cheats are enabled
+ crosshair_trace_plusvisibletriggers(self);
+ if(Drag(trace_ent, TRUE) && !cvar("g_sandbox"))
+ DID_CHEAT();
+ }
+ break;
+ }
+
+ END_CHEAT_FUNCTION();
+}
+
+
+
+
+
+// ENTITY DRAGGING
+
+float Drag(entity e, float candrag)
+{
if(Drag_IsDragging(self))
{
if(self.BUTTON_DRAG)
else
{
if(Drag_CanDrag(self))
- if(self.BUTTON_DRAG)
+ if(self.BUTTON_DRAG && candrag)
{
- crosshair_trace_plusvisibletriggers(self);
- if(trace_ent)
- if(Drag_IsDraggable(trace_ent))
- switch(0)
- {
- default:
- IS_CHEAT(0, 0, CHRAME_DRAG);
- if(trace_ent.draggedby)
- Drag_Finish(trace_ent.draggedby);
- if(trace_ent.tag_entity)
- detach_sameorigin(trace_ent);
- Drag_Begin(self, trace_ent, trace_endpos);
- DID_CHEAT();
- break;
- }
+ if(e)
+ if(Drag_IsDraggable(e))
+ {
+ if(e.draggedby)
+ Drag_Finish(e.draggedby);
+ if(e.tag_entity)
+ detach_sameorigin(e);
+ Drag_Begin(self, e, trace_endpos);
+ return TRUE;
+ }
}
}
-
- END_CHEAT_FUNCTION();
-}
-
-
-
-
-
-// ENTITY DRAGGING
-
-void crosshair_trace_plusvisibletriggers(entity pl)
-{
- entity first;
- entity e;
- first = findchainfloat(solid, SOLID_TRIGGER);
-
- for (e = first; e; e = e.chain)
- if (e.model != "")
- e.solid = SOLID_BSP;
-
- crosshair_trace(pl);
-
- for (e = first; e; e = e.chain)
- e.solid = SOLID_TRIGGER;
+ return FALSE;
}
// on dragger: