return stringwidth(s, FALSE, theSize);
}
-void drawstringright(vector position, string text, vector scale, vector rgb, float theAlpha, float flag)
+void drawstringright(vector position, string text, vector theScale, vector rgb, float theAlpha, float flag)
{
- position_x -= 2 / 3 * strlen(text) * scale_x;
- drawstring(position, text, scale, rgb, theAlpha, flag);
+ position_x -= 2 / 3 * strlen(text) * theScale_x;
+ drawstring(position, text, theScale, rgb, theAlpha, flag);
}
-void drawstringcenter(vector position, string text, vector scale, vector rgb, float theAlpha, float flag)
+void drawstringcenter(vector position, string text, vector theScale, vector rgb, float theAlpha, float flag)
{
- position_x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * scale_x);
- drawstring(position, text, scale, rgb, theAlpha, flag);
+ position_x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * theScale_x);
+ drawstring(position, text, theScale, rgb, theAlpha, flag);
}
// return the string of the onscreen race timer
float GetPlayerColor(float i)
{
- if not(playerslots[i].gotscores) // unconnected
+ if(!playerslots[i].gotscores) // unconnected
return NUM_SPECTATOR;
else if(stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR)
return NUM_SPECTATOR;
// skip this weapon if we don't own it (and onlyowned is enabled)-- or if weapons_complainbubble is showing for this weapon
if(autocvar_hud_panel_weapons_onlyowned)
- if not((weapons_stat & WepSet_FromWeapon(self.weapon)) || (self.weapon == complain_weapon))
+ if (!((weapons_stat & WepSet_FromWeapon(self.weapon)) || (self.weapon == complain_weapon)))
continue;
// figure out the drawing position of weapon
{
if(!autocvar_hud_panel_powerups) return;
if(spectatee_status == -1) return;
- if not(getstati(STAT_ITEMS, 0, 24) & (IT_STRENGTH | IT_INVINCIBLE | IT_SUPERWEAPON)) return;
+ if(!(getstati(STAT_ITEMS, 0, 24) & (IT_STRENGTH | IT_INVINCIBLE | IT_SUPERWEAPON))) return;
if (getstati(STAT_HEALTH) <= 0) return;
strength_time = bound(0, getstatf(STAT_STRENGTH_FINISHED) - time, 99);
float f; // yet another function has this
score = me.(scores[ps_primary]);
- if not((scores_flags[ps_primary] & SFL_TIME) && !teamplay) // race/cts record display on HUD
+ if(!(scores_flags[ps_primary] & SFL_TIME) || teamplay) // race/cts record display on HUD
return; // no records in the actual race
// clientside personal record
num = (Team == NUM_SPECTATOR) ? 16 : Team;
if(teamslots[num])
return teamslots[num];
- if not(add)
+ if (!add)
return world;
tm = spawn();
tm.team = Team;
_drawpic_picpath = string_null;\
} while(0)
-void drawpic_aspect_skin_expanding(vector position, string pic, vector scale, vector rgb, float theAlpha, float flag, float fadelerp)
+void drawpic_aspect_skin_expanding(vector position, string pic, vector theScale, vector rgb, float theAlpha, float flag, float fadelerp)
{
float sz;
sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
- drawpic_aspect_skin(position + expandingbox_resize_centered_box_offset(sz, scale, 1), pic, scale * sz, rgb, theAlpha * (1 - fadelerp), flag);
+ drawpic_aspect_skin(position + expandingbox_resize_centered_box_offset(sz, theScale, 1), pic, theScale * sz, rgb, theAlpha * (1 - fadelerp), flag);
}
-void drawpic_aspect_skin_expanding_two(vector position, string pic, vector scale, vector rgb, float theAlpha, float flag, float fadelerp)
+void drawpic_aspect_skin_expanding_two(vector position, string pic, vector theScale, vector rgb, float theAlpha, float flag, float fadelerp)
{
- drawpic_aspect_skin_expanding(position, pic, scale, rgb, theAlpha, flag, fadelerp);
- drawpic_skin(position, pic, scale, rgb, theAlpha * fadelerp, flag);
+ drawpic_aspect_skin_expanding(position, pic, theScale, rgb, theAlpha, flag, fadelerp);
+ drawpic_skin(position, pic, theScale, rgb, theAlpha * fadelerp, flag);
}
#define SET_POS_AND_SZ_Y_ASPECT(allow_colors)\
float textaspect, oldsz;\
}
vector drawfontscale;
-void drawstring_expanding(vector position, string text, vector scale, vector rgb, float theAlpha, float flag, float fadelerp)
+void drawstring_expanding(vector position, string text, vector theScale, vector rgb, float theAlpha, float flag, float fadelerp)
{
float sz;
sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
drawfontscale = sz * '1 1 0';
dummyfunction(0, 0, 0, 0, 0, 0, 0, 0);
- drawstring(position + expandingbox_resize_centered_box_offset(sz, scale, stringwidth(text, FALSE, scale * (sz / drawfontscale_x)) / (scale_x * sz)), text, scale * (sz / drawfontscale_x), rgb, theAlpha * (1 - fadelerp), flag);
+ drawstring(position + expandingbox_resize_centered_box_offset(sz, theScale, stringwidth(text, FALSE, theScale * (sz / drawfontscale_x)) / (theScale_x * sz)), text, theScale * (sz / drawfontscale_x), rgb, theAlpha * (1 - fadelerp), flag);
// width parameter:
// (scale_x * sz / drawfontscale_x) * drawfontscale_x * SIZE1 / (scale_x * sz)
// SIZE1
drawstring_expanding(pos, text, '1 1 0' * sz_y, color, theAlpha, drawflag, fadelerp);
}
-void drawcolorcodedstring_expanding(vector position, string text, vector scale, float theAlpha, float flag, float fadelerp)
+void drawcolorcodedstring_expanding(vector position, string text, vector theScale, float theAlpha, float flag, float fadelerp)
{
float sz;
sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
drawfontscale = sz * '1 1 0';
dummyfunction(0, 0, 0, 0, 0, 0, 0, 0);
- drawcolorcodedstring(position + expandingbox_resize_centered_box_offset(sz, scale, stringwidth(text, TRUE, scale * (sz / drawfontscale_x)) / (scale_x * sz)), text, scale * (sz / drawfontscale_x), theAlpha * (1 - fadelerp), flag);
+ drawcolorcodedstring(position + expandingbox_resize_centered_box_offset(sz, theScale, stringwidth(text, TRUE, theScale * (sz / drawfontscale_x)) / (theScale_x * sz)), text, theScale * (sz / drawfontscale_x), theAlpha * (1 - fadelerp), flag);
drawfontscale = '1 1 0';
}
vector tri;
string tex;
tex = getsurfacetexture(e, i_s);
- if not(tex)
+ if (!tex)
return 0; // this is beyond the last one
n_t = getsurfacenumtriangles(e, i_s);
for(i_t = 0; i_t < n_t; ++i_t)
void func_breakable_colormod()
{
float h;
- if not(self.spawnflags & 2)
+ if (!(self.spawnflags & 2))
return;
h = self.health / self.max_health;
if(h < 0.25)
self.colormod = '1 0 0' + '0 1 0' * (2 * h - 0.5);
else
self.colormod = '1 1 1';
+
+ CSQCMODEL_AUTOUPDATE();
}
void func_breakable_look_destroyed()
{
func_breakable_look_destroyed();
func_breakable_behave_destroyed();
+
+ CSQCMODEL_AUTOUPDATE();
}
void func_breakable_restore()
{
func_breakable_look_restore();
func_breakable_behave_restore();
+
+ CSQCMODEL_AUTOUPDATE();
}
vector debrisforce; // global, set before calling this
func_breakable_behave_destroyed();
else
func_breakable_behave_restore();
+
+ CSQCMODEL_AUTOUPDATE();
}
// destructible walls that can be used to trigger target_objective_decrease
self.reset = func_breakable_reset;
func_breakable_reset();
+
+ CSQCMODEL_AUTOINIT();
}
// for use in maps with a "model" key set
vector org;
float i;
- if not (self.count)
+ if (!self.count)
self.count = 40;
// White shockwave
#endif
self.lasthealth = self.health;
}
- else if not(warmup_stage)
+ else if (!warmup_stage)
{
if (attacker == self)
bprint(Team_ColoredFullName(self.team), " generator spontaneously exploded due to overtime!\n");
{
entity e;
float a;
- if not(IS_PLAYER(other))
+ if (!IS_PLAYER(other))
return;
a = onslaught_controlpoint_attackable(self, other.team);
if(a != 2 && a != 4)
onslaught_updatelinks();
}
+void onslaught_controlpoint_think()
+{
+ self.nextthink = time;
+ CSQCMODEL_AUTOUPDATE();
+}
+
void onslaught_controlpoint_reset()
{
if(self.goalentity && self.goalentity != world)
self.isshielded = TRUE;
self.enemy.solid = SOLID_NOT;
self.enemy.colormap = self.colormap;
- self.think = self.enemy.think = func_null;
- self.nextthink = 0; // don't like func_null :P
+ self.think = onslaught_controlpoint_think;
+ self.enemy.think = func_null;
+ self.nextthink = time; // don't like func_null :P
setmodel(self, "models/onslaught/controlpoint_pad.md3");
//setsize(self, '-32 -32 0', '32 32 8');
activator = self;
SUB_UseTargets(); // to reset the structures, playerspawns etc.
+
+ CSQCMODEL_AUTOUPDATE();
}
/*QUAKED spawnfunc_onslaught_controlpoint (0 .5 .8) (-32 -32 0) (32 32 128)
self.enemy.colormap = self.colormap;
waypoint_spawnforitem(self);
+
+ self.think = onslaught_controlpoint_think;
+ self.nextthink = time;
WaypointSprite_SpawnFixed(string_null, self.origin + '0 0 128', self, sprite, RADARICON_NONE, '0 0 0');
WaypointSprite_UpdateRule(self.sprite, NUM_TEAM_2, SPRITERULE_TEAMPLAY);
onslaught_updatelinks();
self.reset = onslaught_controlpoint_reset;
+
+ CSQCMODEL_AUTOINIT();
}
float onslaught_link_send(entity to, float sendflags)
intensity = vlen(self.velocity) + vlen(other.velocity);
if(intensity) // avoid divisions by 0
intensity /= 2; // average the two velocities
- if not(intensity >= autocvar_g_sandbox_object_material_velocity_min)
+ if (!(intensity >= autocvar_g_sandbox_object_material_velocity_min))
return; // impact not strong enough to do anything
// now offset intensity and apply it to the effects
intensity -= autocvar_g_sandbox_object_material_velocity_min; // start from minimum velocity, not actual velocity
}
self.nextthink = time;
+
+ CSQCMODEL_AUTOUPDATE();
}
.float old_solid, old_movetype;
return trace_ent; // don't check permissions, anyone can edit this object
if(trace_ent.crypto_idfp == "")
return trace_ent; // the player who spawned this object did not have an UID, so anyone can edit it
- if not(trace_ent.realowner != self && autocvar_g_sandbox_editor_free < 2)
+ if (!(trace_ent.realowner != self && autocvar_g_sandbox_editor_free < 2))
return trace_ent; // object does not belong to the player, and players can only edit their own objects on this server
return world;
}
{
// spawn a new object with default properties
- entity e;
+ entity e, oldself;
e = spawn();
e.classname = "object";
e.takedamage = DAMAGE_AIM;
setorigin(e, trace_endpos);
e.angles_y = self.v_angle_y;
}
+
+ oldself = self;
+ self = e;
+ CSQCMODEL_AUTOINIT();
+ self = oldself;
object_count += 1;
return e;
print_to(self, "^1SANDBOX - WARNING: ^7Attempted to spawn an object without specifying a model. Please specify the path to your model file after the 'object_spawn' command");
return TRUE;
}
- if not(fexists(argv(2)))
+ if (!(fexists(argv(2))))
{
print_to(self, "^1SANDBOX - WARNING: ^7Attempted to spawn an object with a non-existent model. Make sure the path to your model file is correct");
return TRUE;