if (index <= 0)
own = entitybyindex(-index);
else
- own = findfloat(world, entnum, index);
+ own = findfloat(NULL, entnum, index);
vector org_from = stov(argv(3));
vector org_to = stov(argv(4));
vector dir_from = stov(argv(5));
void CSQCModel_AutoTagIndex_Apply(entity this)
{
if(this.tag_entity && wasfreed(this.tag_entity))
- this.tag_entity = world;
+ this.tag_entity = NULL;
viewloc_SetTags(this);
bool changed = 0;
if(this.tag_entity.entnum != this.tag_networkentity)
{
- this.tag_entity = findfloat(world, entnum, this.tag_networkentity);
+ this.tag_entity = findfloat(NULL, entnum, this.tag_networkentity);
changed = 1;
}
if(!this.tag_index)
{
// we need to prevent this from 'appening
- this.tag_entity = world;
+ this.tag_entity = NULL;
this.drawmask = 0;
LOG_TRACE("h_ model lacks weapon attachment, but v_ model is attached to it\n");
}
void reset_tab_panels()
{
for (int i = 0; i < hud_panels_COUNT; ++i)
- tab_panels[i] = world;
+ tab_panels[i] = NULL;
}
float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
{
highlightedAction = 0;
HUD_Panel_FirstInDrawQ(highlightedPanel.panel_id);
}
- tab_panel = world;
+ tab_panel = NULL;
reset_tab_panels();
}
}
level = floor(tab_panel_pos.y / level_height) * level_height; //starting level
candidate_pos.x = (!tab_backward) ? vid_conwidth : 0;
start_posX = tab_panel_pos.x;
- tab_panel = world;
+ tab_panel = NULL;
k=0;
while(++k)
{
reset_tab_panels();
if (!old_tab_panel)
{
- tab_panel = world;
+ tab_panel = NULL;
return true;
}
starting_panel = old_tab_panel;
- old_tab_panel = world;
+ old_tab_panel = NULL;
goto find_tab_panel; //u must find tab_panel!
}
if (!tab_backward)
cvar_set(strcat("hud_panel_", highlightedPanel_backup.panel_name, "_pos"), s);
s = strcat(ftos(panel_size_backup.x/vid_conwidth), " ", ftos(panel_size_backup.y/vid_conheight));
cvar_set(strcat("hud_panel_", highlightedPanel_backup.panel_name, "_size"), s);
- highlightedPanel_backup = world;
+ highlightedPanel_backup = NULL;
}
}
else if(nPrimary == 's' && hudShiftState & S_CTRL) // save config
return;
}
}
- highlightedPanel = world;
+ highlightedPanel = NULL;
highlightedAction = 0;
}
if (tab_panel)
{
//stop ctrl-tab selection
- tab_panel = world;
+ tab_panel = NULL;
reset_tab_panels();
}
HUD_Panel_Highlight(mouseClicked & S_MOUSE1); // sets highlightedPanel, highlightedAction, panel_click_distance, panel_click_resizeorigin
void HUD_Score_Rankings(vector pos, vector mySize, entity me)
{
float score;
- entity tm = world, pl;
+ entity tm = NULL, pl;
int SCOREPANEL_MAX_ENTRIES = 6;
float SCOREPANEL_ASPECTRATIO = 2;
int entries = bound(1, floor(SCOREPANEL_MAX_ENTRIES * mySize.y/mySize.x * SCOREPANEL_ASPECTRATIO), SCOREPANEL_MAX_ENTRIES);
pl = pl.sort_next;
if(scores_flags[ps_primary] & SFL_ZERO_IS_WORST)
if(pl.scores[ps_primary] == 0)
- pl = world;
+ pl = NULL;
score = me.(scores[ps_primary]);
timer = TIME_ENCODED_TOSTRING(score);
case NUM_TEAM_4:
break;
default:
- if(GetTeam(Team, false) == world)
+ if(GetTeam(Team, false) == NULL)
{
LOG_TRACEF("trying to switch to unsupported team %d\n", Team);
Team = NUM_SPECTATOR;
case 0:
break;
default:
- if(GetTeam(Team, false) == world)
+ if(GetTeam(Team, false) == NULL)
{
LOG_TRACEF("trying to switch to unsupported team %d\n", Team);
Team = NUM_SPECTATOR;
// player disconnected
SetTeam(e, -1);
RemovePlayer(e);
- e.sort_prev = world;
+ e.sort_prev = NULL;
//e.gotscores = 0;
}
}
string thelabel = mv_desc[id], ts;
entity last = title;
- entity next = world;
+ entity next = NULL;
float nlines = 0;
if( thelabel != "")
{
for(i = 0; i < mv_num_maps; ++i )
mv_flags_start[i] = mv_flags[i];
- // Assume mv_pk3list is world, there should only be 1 mapvote per round
- mv_pk3list = world; // I'm still paranoid!
+ // Assume mv_pk3list is NULL, there should only be 1 mapvote per round
+ mv_pk3list = NULL; // I'm still paranoid!
for(i = 0; i < mv_num_maps; ++i)
{
if(teamslots[num])
return teamslots[num];
if (!add)
- return world;
+ return NULL;
entity tm = new_pure(team);
tm.team = Team;
teamslots[num] = tm;
// todo: avoid very long and very short sounds from wave stretching using different sound files? seems unnecessary
// todo: normalize sound pressure levels? seems unnecessary
- sound7(world, CH_INFO, SND(HIT), VOL_BASE, ATTN_NONE, pitch_shift * 100, 0);
+ sound7(NULL, CH_INFO, SND(HIT), VOL_BASE, ATTN_NONE, pitch_shift * 100, 0);
}
unaccounted_damage = 0;
hitsound_time_prev = time;
float typehit_time = STAT(TYPEHIT_TIME);
if (COMPARE_INCREASING(typehit_time, typehit_time_prev) > autocvar_cl_hitsound_antispam_time)
{
- sound(world, CH_INFO, SND_TYPEHIT, VOL_BASE, ATTN_NONE);
+ sound(NULL, CH_INFO, SND_TYPEHIT, VOL_BASE, ATTN_NONE);
typehit_time_prev = typehit_time;
}
}
{
float vehicle_chase = (hud != HUD_NORMAL && (autocvar_cl_eventchase_vehicle || spectatee_status > 0));
float ons_roundlost = (gametype == MAPINFO_TYPE_ONSLAUGHT && STAT(ROUNDLOST));
- entity gen = world;
+ entity gen = NULL;
float vehicle_viewdist = 0;
vector vehicle_viewofs = '0 0 0';
eff_cnt = ReadByte();
if(eff_trail)
- WarpZone_TrailParticles(world, particleeffectnum(eff), v, vel);
+ WarpZone_TrailParticles(NULL, particleeffectnum(eff), v, vel);
else
pointparticles(eff, v, vel, eff_cnt);
return true;
if(DEATH_ISVEHICLE(w_deathtype))
{
- traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world);
+ traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, NULL);
if(trace_plane_normal != '0 0 0')
w_backoff = trace_plane_normal;
else
if(DEATH_ISTURRET(w_deathtype))
{
- traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world);
+ traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, NULL);
if(trace_plane_normal != '0 0 0')
w_backoff = trace_plane_normal;
else
Weapon hitwep = DEATH_WEAPONOF(w_deathtype);
w_random = prandom();
- traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, world);
+ traceline(w_org - normalize(force) * 16, w_org + normalize(force) * 16, MOVE_NOMONSTERS, NULL);
if(trace_fraction < 1 && hitwep != WEP_VORTEX && hitwep != WEP_VAPORIZER)
w_backoff = trace_plane_normal;
else
o.y = ReadCoord();
o.z = ReadCoord();
// TODO: is this really what we want to be doing? Footsteps that follow the player at head height?
- if (who == player_currententnum) e = findfloat(world, entnum, who); // play at camera position for full volume
+ if (who == player_currententnum) e = findfloat(NULL, entnum, who); // play at camera position for full volume
else if (e) e.origin = o;
if (e)
{
o.x = ReadCoord();
o.y = ReadCoord();
o.z = ReadCoord();
- if (who == player_currententnum) e = findfloat(world, entnum, who); // play at camera position for full volume
+ if (who == player_currententnum) e = findfloat(NULL, entnum, who); // play at camera position for full volume
else if (e) e.origin = o;
if (e)
{
entity VM = def; \
int voicetype = VM.m_playersoundvt; \
bool ownteam = (voicetype == VOICETYPE_TEAMRADIO); \
- int flood = Say(this, ownteam, world, msg, true); \
+ int flood = Say(this, ownteam, NULL, msg, true); \
bool fake; \
if (IS_SPEC(this) || IS_OBSERVER(this) || flood < 0) fake = true; \
else if (flood > 0) fake = false; \
int steps = min(16, floor(length / seglength));
if (steps < 1)
{
- te_lightning1(world, from, to);
+ te_lightning1(NULL, from, to);
return;
}
float drift = drifts * (1 - (i / steps)) + drifte * (i / steps);
vector dirnew = normalize(direction * (1 - drift) + randomvec() * drift);
vector pos = pos_l + dirnew * steplength;
- te_lightning1(world, pos_l, pos);
+ te_lightning1(NULL, pos_l, pos);
// WTF endless recursion if branchfactor is 1.0 (possibly due to adding branchfactor_add). FIXME
// if(random() < branchfactor)
// cl_effects_lightningarc(pos, pos + (dirnew * length * 0.25),seglength,drifts,drifte,min(branchfactor + branchfactor_add,1),branchfactor_add);
pos_l = pos;
}
- te_lightning1(world, pos_l, to);
+ te_lightning1(NULL, pos_l, to);
}
else
{
- te_lightning1(world, from, to);
+ te_lightning1(NULL, from, to);
}
}
if (autocvar_cl_effects_lightningarc_simple)
{
- te_lightning1(world, from, to);
+ te_lightning1(NULL, from, to);
}
else
{
while (1)
{
e = findchain(classname, cname);
- if (e == world) break;
+ if (e == NULL) break;
// walk the list and count the entities, find the oldest
// initialize our search with the first entity
c = 1;
float OtherTeam(float t) //works only if there are two teams on the map!
{
entity e;
- e = find(world, classname, "nexball_team");
+ e = find(NULL, classname, "nexball_team");
if(e.team == t)
e = find(e, classname, "nexball_team");
return e.team;
if(!autocvar_sv_eventlog)
return;
s = strcat(":nexball:", mode);
- if(actor != world)
+ if(actor != NULL)
s = strcat(s, ":", ftos(actor.playerid));
GameLogEcho(s);
}
if(ownr)
{
ownr.effects &= ~autocvar_g_nexball_basketball_effects_default;
- ownr.ballcarried = world;
+ ownr.ballcarried = NULL;
if(ownr.metertime)
{
ownr.metertime = 0;
ball.effects &= ~EF_NOSHADOW;
ball.owner.effects &= ~autocvar_g_nexball_basketball_effects_default;
- setattachment(ball, world, "");
+ setattachment(ball, NULL, "");
setorigin(ball, org);
ball.movetype = MOVETYPE_BOUNCE;
UNSET_ONGROUND(ball);
}
WaypointSprite_Kill(ball.owner.waypointsprite_attachedforcarrier);
- WaypointSprite_Spawn(WP_NbBall, 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER); // no health bar please
+ WaypointSprite_Spawn(WP_NbBall, 0, 0, ball, '0 0 64', NULL, ball.team, ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER); // no health bar please
WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
- ball.owner.ballcarried = world;
- ball.owner = world;
+ ball.owner.ballcarried = NULL;
+ ball.owner = NULL;
}
void InitBall(entity this)
setthink(this, ResetBall);
this.nextthink = time + autocvar_g_nexball_delay_idle + 3;
this.teamtime = 0;
- this.pusher = world;
+ this.pusher = NULL;
this.team = false;
_sound(this, CH_TRIGGER, this.noise1, VOL_BASE, ATTEN_NORM);
WaypointSprite_Ping(this.waypointsprite_attachedforcarrier);
- LogNB("init", world);
+ LogNB("init", NULL);
}
void ResetBall(entity this)
this.movetype = MOVETYPE_NOCLIP;
this.velocity = '0 0 0'; // just in case?
if(!this.cnt)
- LogNB("resetidle", world);
+ LogNB("resetidle", NULL);
this.cnt = 2;
this.nextthink = time;
}
{
bool t_red = false, t_blue = false, t_yellow = false, t_pink = false;
entity e;
- for(e = world; (e = find(e, classname, "nexball_goal"));)
+ for(e = NULL; (e = find(e, classname, "nexball_goal"));)
{
switch(e.team)
{
void nb_delayedinit(entity this)
{
- if(find(world, classname, "nexball_team") == world)
+ if(find(NULL, classname, "nexball_team") == NULL)
nb_spawnteams();
nb_ScoreRules(nb_teams);
}
entity ball, attacker;
attacker = this.owner;
//this.think = func_null;
- //this.enemy = world;
+ //this.enemy = NULL;
PROJECTILE_TOUCH(this);
if(attacker.team != other.team || autocvar_g_nexball_basketball_teamsteal)
return;
W_SetupShot(actor, false, 4, SND_NB_SHOOT1, CH_WEAPON_A, 0);
- tracebox(w_shotorg, BALL_MINS, BALL_MAXS, w_shotorg, MOVE_WORLDONLY, world);
+ tracebox(w_shotorg, BALL_MINS, BALL_MAXS, w_shotorg, MOVE_WORLDONLY, NULL);
if(trace_startsolid)
{
if(actor.metertime)
if(player.ballcarried.wait < time && player.ballcarried.enemy)
{
//centerprint(player, sprintf("Lost lock on %s", player.ballcarried.enemy.netname));
- player.ballcarried.enemy = world;
+ player.ballcarried.enemy = NULL;
}
*/
radar_showennemies = autocvar_g_nexball_radar_showallplayers;
- InitializeEntity(world, nb_delayedinit, INITPRIO_GAMETYPE);
+ InitializeEntity(NULL, nb_delayedinit, INITPRIO_GAMETYPE);
WEP_NEXBALL.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
ActivateTeamplay();
setmodel(this, MDL_ONS_CP);
setsize(this, CPICON_MIN, CPICON_MAX);
- if(this.icon_realmodel == world)
+ if(this.icon_realmodel == NULL)
{
this.icon_realmodel = spawn();
setmodel(this.icon_realmodel, MDL_Null);
void ons_DelayedLinkSetup(entity this)
{
- this.goalentity = find(world, targetname, this.target);
- this.enemy = find(world, targetname, this.target2);
+ this.goalentity = find(NULL, targetname, this.target);
+ this.enemy = find(NULL, targetname, this.target2);
if(!this.goalentity) { objerror(this, "can not find target\n"); }
if(!this.enemy) { objerror(this, "can not find target2\n"); }
{
sound(this, CH_TRIGGER, SND_GRENADE_IMPACT, VOL_BASE, ATTEN_NORM);
pointparticles(EFFECT_ROCKET_EXPLODE, this.origin, '0 0 0', 1);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(this.team, INFO_ONSLAUGHT_CPDESTROYED), this.owner.message, attacker.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_ONSLAUGHT_CPDESTROYED), this.owner.message, attacker.netname);
PlayerScore_Add(attacker, SP_ONS_TAKES, 1);
PlayerScore_Add(attacker, SP_SCORE, 10);
- this.owner.goalentity = world;
+ this.owner.goalentity = NULL;
this.owner.islinked = false;
this.owner.iscaptured = false;
this.owner.team = 0;
if(IS_PLAYER(this.owner.ons_toucher))
{
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ONSLAUGHT_CAPTURE, this.owner.ons_toucher.netname, this.owner.message);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ONSLAUGHT_CAPTURE, this.owner.ons_toucher.netname, this.owner.message);
Send_Notification(NOTIF_ALL_EXCEPT, this.owner.ons_toucher, MSG_CENTER, APP_TEAM_NUM(this.owner.ons_toucher.team, CENTER_ONS_CAPTURE), this.owner.message);
Send_Notification(NOTIF_ONE, this.owner.ons_toucher, MSG_CENTER, CENTER_ONS_CAPTURE, this.owner.message);
PlayerScore_Add(this.owner.ons_toucher, SP_ONS_CAPS, 1);
PlayerTeamScore_AddScore(this.owner.ons_toucher, 10);
}
- this.owner.ons_toucher = world;
+ this.owner.ons_toucher = NULL;
onslaught_updatelinks();
if(this.goalentity)
remove(this.goalentity);
- this.goalentity = world;
+ this.goalentity = NULL;
this.team = 0;
this.colormap = 1024;
this.iscaptured = false;
this.islinked = false;
this.isshielded = true;
setthink(this, ons_ControlPoint_Think);
- this.ons_toucher = world;
+ this.ons_toucher = NULL;
this.nextthink = time + ONS_CP_THINKRATE;
setmodel_fixsize(this, MDL_ONS_CP_PAD1);
else
{
if (attacker == this)
- Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(this.team, INFO_ONSLAUGHT_GENDESTROYED_OVERTIME));
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_ONSLAUGHT_GENDESTROYED_OVERTIME));
else
{
- Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(this.team, INFO_ONSLAUGHT_GENDESTROYED));
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_ONSLAUGHT_GENDESTROYED));
PlayerScore_Add(attacker, SP_SCORE, 100);
}
this.iscaptured = false;
if (!wpforenemy_announced)
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_OVERTIME_CONTROLPOINT);
- sound(world, CH_INFO, SND_ONS_GENERATOR_DECAY, VOL_BASE, ATTEN_NONE);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_OVERTIME_CONTROLPOINT);
+ sound(NULL, CH_INFO, SND_ONS_GENERATOR_DECAY, VOL_BASE, ATTEN_NONE);
wpforenemy_announced = true;
}
if(winner_team > 0)
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
- Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
TeamScore_AddToTeam(winner_team, ST_ONS_CAPS, +1);
}
else if(winner_team == -1)
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_TIED);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_TIED);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_TIED);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_TIED);
}
ons_stalemate = false;
// We'll consider only the best case
bestvalue = 99999999999;
- cp = world;
+ cp = NULL;
for(cp1 = ons_worldcplist; cp1; cp1 = cp1.ons_worldcpnext)
{
if (!cp1.wpconsidered)
// Should be attacked
// Rate waypoints near it
found = false;
- best = world;
+ best = NULL;
bestvalue = 99999999999;
for(radius=0; radius<1000 && !found; radius+=500)
{
// Should be attacked
// Rate waypoints near it
found = false;
- bestwp = world;
+ bestwp = NULL;
best = 99999999999;
for(wp=findradius(g.origin,400); wp; wp=wp.chain)
if(IS_DEAD(this))
return;
- this.havocbot_ons_target = world;
+ this.havocbot_ons_target = NULL;
// TODO: Defend control points or generator if necessary
*/
entity ons_Nearest_ControlPoint(entity this, vector pos, float max_dist)
{
- entity tmp_entity, closest_target = world;
+ entity tmp_entity, closest_target = NULL;
tmp_entity = findchain(classname, "onslaught_controlpoint");
while(tmp_entity)
{
if(SAME_TEAM(tmp_entity, this))
if(tmp_entity.iscaptured)
if(max_dist <= 0 || vdist(tmp_entity.origin - pos, <=, max_dist))
- if(vlen2(tmp_entity.origin - pos) <= vlen2(closest_target.origin - pos) || closest_target == world)
+ if(vlen2(tmp_entity.origin - pos) <= vlen2(closest_target.origin - pos) || closest_target == NULL)
closest_target = tmp_entity;
tmp_entity = tmp_entity.chain;
}
{
if(SAME_TEAM(tmp_entity, this))
if(max_dist <= 0 || vdist(tmp_entity.origin - pos, <, max_dist))
- if(vlen2(tmp_entity.origin - pos) <= vlen2(closest_target.origin - pos) || closest_target == world)
+ if(vlen2(tmp_entity.origin - pos) <= vlen2(closest_target.origin - pos) || closest_target == NULL)
closest_target = tmp_entity;
tmp_entity = tmp_entity.chain;
}
*/
entity ons_Nearest_ControlPoint_2D(entity this, vector pos, float max_dist)
{
- entity tmp_entity, closest_target = world;
+ entity tmp_entity, closest_target = NULL;
vector delta;
float smallest_distance = 0, distance;
if(SAME_TEAM(tmp_entity, this))
if(tmp_entity.iscaptured)
if(max_dist <= 0 || distance <= max_dist)
- if(closest_target == world || distance <= smallest_distance )
+ if(closest_target == NULL || distance <= smallest_distance )
{
closest_target = tmp_entity;
smallest_distance = distance;
if(SAME_TEAM(tmp_entity, this))
if(max_dist <= 0 || distance <= max_dist)
- if(closest_target == world || distance <= smallest_distance )
+ if(closest_target == NULL || distance <= smallest_distance )
{
closest_target = tmp_entity;
smallest_distance = distance;
tracebox(loc, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), loc, MOVE_NORMAL, player);
if(trace_fraction == 1.0 && !trace_startsolid)
{
- traceline(tele_target.origin, loc, MOVE_NOMONSTERS, tele_target); // double check to make sure we're not spawning outside the world
+ traceline(tele_target.origin, loc, MOVE_NOMONSTERS, tele_target); // double check to make sure we're not spawning outside the NULL
if(trace_fraction == 1.0 && !trace_startsolid)
{
if ( tele_effects )
if ( player.ons_spawn_by )
if ( ons_Teleport(player,player.ons_spawn_by,autocvar_g_onslaught_teleport_radius,false) )
{
- player.ons_spawn_by = world;
+ player.ons_spawn_by = NULL;
return false;
}
if(random() <= autocvar_g_onslaught_spawn_at_controlpoints_chance)
{
float random_target = autocvar_g_onslaught_spawn_at_controlpoints_random;
- entity tmp_entity, closest_target = world;
+ entity tmp_entity, closest_target = NULL;
vector spawn_loc = player.ons_deathloc;
// new joining player or round reset, don't bother checking
if(SAME_TEAM(tmp_entity, player))
if(random_target)
RandomSelection_Add(tmp_entity, 0, string_null, 1, 1);
- else if(vlen2(tmp_entity.origin - spawn_loc) <= vlen2(closest_target.origin - spawn_loc) || closest_target == world)
+ else if(vlen2(tmp_entity.origin - spawn_loc) <= vlen2(closest_target.origin - spawn_loc) || closest_target == NULL)
closest_target = tmp_entity;
}
tracebox(loc, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), loc, MOVE_NORMAL, player);
if(trace_fraction == 1.0 && !trace_startsolid)
{
- traceline(closest_target.origin, loc, MOVE_NOMONSTERS, closest_target); // double check to make sure we're not spawning outside the world
+ traceline(closest_target.origin, loc, MOVE_NOMONSTERS, closest_target); // double check to make sure we're not spawning outside the NULL
if(trace_fraction == 1.0 && !trace_startsolid)
{
setorigin(player, loc);
if(random() <= autocvar_g_onslaught_spawn_at_generator_chance)
{
float random_target = autocvar_g_onslaught_spawn_at_generator_random;
- entity tmp_entity, closest_target = world;
+ entity tmp_entity, closest_target = NULL;
vector spawn_loc = player.ons_deathloc;
// new joining player or round reset, don't bother checking
else
{
if(SAME_TEAM(tmp_entity, player))
- if(vlen2(tmp_entity.origin - spawn_loc) <= vlen2(closest_target.origin - spawn_loc) || closest_target == world)
+ if(vlen2(tmp_entity.origin - spawn_loc) <= vlen2(closest_target.origin - spawn_loc) || closest_target == NULL)
closest_target = tmp_entity;
}
}
tracebox(loc, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), loc, MOVE_NORMAL, player);
if(trace_fraction == 1.0 && !trace_startsolid)
{
- traceline(closest_target.origin, loc, MOVE_NOMONSTERS, closest_target); // double check to make sure we're not spawning outside the world
+ traceline(closest_target.origin, loc, MOVE_NOMONSTERS, closest_target); // double check to make sure we're not spawning outside the NULL
if(trace_fraction == 1.0 && !trace_startsolid)
{
setorigin(player, loc);
{
entity mon = M_ARGV(0, entity);
- entity e = find(world, targetname, mon.target);
- if (e != world)
+ entity e = find(NULL, targetname, mon.target);
+ if (e != NULL)
mon.team = e.team;
}
if(own.targetname)
{
- entity e = find(world, target, own.targetname);
- if(e != world)
+ entity e = find(NULL, target, own.targetname);
+ if(e != NULL)
{
own.team = e.team;
if(own.targetname)
{
- entity e = find(world, target, own.targetname);
- if(e != world)
+ entity e = find(NULL, target, own.targetname);
+ if(e != NULL)
{
own.team = e.team;
own.active = ACTIVE_NOT;
entity closest_target = ons_Nearest_ControlPoint_2D(player, pos, autocvar_g_onslaught_click_radius);
- if ( closest_target == world )
+ if ( closest_target == NULL )
{
sprint(player, "\nNo control point found\n");
return true;
// ONS uses somewhat backwards linking.
if(turret.target)
{
- entity e = find(world, targetname, turret.target);
- if (e != world)
+ entity e = find(NULL, targetname, turret.target);
+ if (e != NULL)
turret.team = e.team;
}
// scoreboard setup
void ons_ScoreRules()
{
- CheckAllowedTeams(world);
+ CheckAllowedTeams(NULL);
ScoreRules_basics(((c4>=0) ? 4 : (c3>=0) ? 3 : 2), SFL_SORT_PRIO_PRIMARY, 0, true);
ScoreInfo_SetLabel_TeamScore (ST_ONS_CAPS, "destroyed", SFL_SORT_PRIO_PRIMARY);
ScoreInfo_SetLabel_PlayerScore(SP_ONS_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
g_onslaught = true;
ons_captureshield_force = autocvar_g_onslaught_shield_force;
- InitializeEntity(world, ons_DelayedInit, INITPRIO_GAMETYPE);
+ InitializeEntity(NULL, ons_DelayedInit, INITPRIO_GAMETYPE);
}
#endif
MapInfo_ClearTemps();
// sometimes the glob isn't sorted nicely, so fix it here...
- heapsort(MapInfo_count, _MapInfo_FilterList_swap, _MapInfo_FilterList_cmp, world);
+ heapsort(MapInfo_count, _MapInfo_FilterList_swap, _MapInfo_FilterList_cmp, NULL);
return 1;
}
MapInfo_ClearTemps();
// sometimes the glob isn't sorted nicely, so fix it here...
- heapsort(MapInfo_count, _MapInfo_FilterList_swap, _MapInfo_FilterList_cmp, world);
+ heapsort(MapInfo_count, _MapInfo_FilterList_swap, _MapInfo_FilterList_cmp, NULL);
}
void MapInfo_Filter_Free()
return;
active_minigame.minigame_event(active_minigame,"deactivate");
- entity e = world;
+ entity e = NULL;
while( (e = findentity(e, owner, active_minigame)) )
if ( e.minigame_autoclean )
{
minigame_autoclean_entity(e);
}
- minigame_self = world;
- active_minigame = world;
+ minigame_self = NULL;
+ active_minigame = NULL;
if ( auto_close_minigamemenu )
{
}
if ( minigame_self.owner != minigame )
- minigame_self = world;
+ minigame_self = NULL;
active_minigame = minigame;
active_minigame.minigame_event(active_minigame,"activate");
void minigame_read_owner(entity this)
{
string owner_name = ReadString_Raw();
- this.owner = world;
+ this.owner = NULL;
do
this.owner = find(this.owner,netname,owner_name);
while ( this.owner && this.owner.classname != "minigame" );
this.netname = ReadString_Zoned();
}
- entity minigame_ent = world;
+ entity minigame_ent = NULL;
if ( this.classname == "minigame" )
{
// Whethere there's an active minigame
float minigame_isactive()
{
- return active_minigame != world;
+ return active_minigame != NULL;
}
// Execute a minigame command
#define FOREACH_MINIGAME_ENTITY(entityvar) \
- entityvar=world; \
+ entityvar=NULL; \
while( (entityvar = findentity(entityvar,owner,active_minigame)) )
// Draws the minigame game board
void HUD_MinigameBoard ()
{
- entity hud_minigame = world;
+ entity hud_minigame = NULL;
if(!autocvar__hud_configure)
hud_minigame = active_minigame.descriptor;
// Draws the minigame status panel
void HUD_MinigameStatus ()
{
- entity hud_minigame = world;
+ entity hud_minigame = NULL;
if(!autocvar__hud_configure)
hud_minigame = active_minigame.descriptor;
HUD_MinigameMenu_last_entry = e.list_prev;
if ( HUD_MinigameMenu_activeitem == e )
- HUD_MinigameMenu_activeitem = world;
+ HUD_MinigameMenu_activeitem = NULL;
remove(e);
}
{
if ( HUD_MinigameMenu_activeitem &&
HUD_MinigameMenu_activeitem.owner == this )
- HUD_MinigameMenu_activeitem = world;
+ HUD_MinigameMenu_activeitem = NULL;
this.flags &= ~2;
- for ( e = this.list_next; e != world && e.owner == this; e = this.list_next )
+ for ( e = this.list_next; e != NULL && e.owner == this; e = this.list_next )
{
if ( e.flags & 2 )
HUD_MinigameMenu_Click(e);
}
else
{
- for ( e = HUD_MinigameMenu_entries; e != world; e = e.list_next )
+ for ( e = HUD_MinigameMenu_entries; e != NULL; e = e.list_next )
{
if ( e.flags & 2 && e.origin_x == this.origin_x)
HUD_MinigameMenu_Click(e);
{
if ( HUD_MinigameMenu_Click_ExpandCollapse(this) )
{
- entity e = world;
+ entity e = NULL;
entity curr;
entity prev = this;
while( (e = find(e,classname,"minigame")) )
for(int i = 0; i < maxclients; ++i)
{
if ( player_localnum != i && playerslots[i] && entcs_GetName(i) != "" &&
- !findfloat(world,minigame_playerslot,i+1) && playerslots[i].ping )
+ !findfloat(NULL,minigame_playerslot,i+1) && playerslots[i].ping )
{
e = HUD_MinigameMenu_SpawnSubEntry(
strzone(entcs_GetName(i)), HUD_MinigameMenu_ClickInvite_Entry,
if ( HUD_MinigameMenu_IsOpened() )
{
entity e, p;
- for ( e = HUD_MinigameMenu_entries; e != world; e = p )
+ for ( e = HUD_MinigameMenu_entries; e != NULL; e = p )
{
p = e.list_next;
remove(e);
}
- HUD_MinigameMenu_entries = world;
- HUD_MinigameMenu_last_entry = world;
- HUD_MinigameMenu_activeitem = world;
+ HUD_MinigameMenu_entries = NULL;
+ HUD_MinigameMenu_last_entry = NULL;
+ HUD_MinigameMenu_activeitem = NULL;
if(autocvar_hud_cursormode)
if ( !autocvar__hud_configure )
setcursormode(0);
entity e;
if ( active_minigame )
{
- for ( e = HUD_MinigameMenu_last_entry; e != world; e = e.list_prev )
+ for ( e = HUD_MinigameMenu_last_entry; e != NULL; e = e.list_prev )
if ( e.classname == "hud_minigamemenu_exit" )
{
HUD_MinigameMenu_EraseEntry(e);
else
{
entity p;
- for ( e = HUD_MinigameMenu_last_entry; e != world; e = p.list_prev )
+ for ( e = HUD_MinigameMenu_last_entry; e != NULL; e = p.list_prev )
{
p = e;
if ( e.classname == "hud_minigamemenu_current" )
break;
}
}
- for ( e = HUD_MinigameMenu_last_entry; e != world; e = e.list_prev )
+ for ( e = HUD_MinigameMenu_last_entry; e != NULL; e = e.list_prev )
if ( e.classname == "hud_minigamemenu_exit" )
return;
entity exit = HUD_MinigameMenu_SpawnEntry(
_("Join"),'0 0 0',hud_fontsize*1.5,'0.7 0.84 1', HUD_MinigameMenu_ClickJoin),
HUD_MinigameMenu_last_entry );
HUD_MinigameMenu_CurrentButton();
- HUD_MinigameMenu_activeitem = world;
+ HUD_MinigameMenu_activeitem = NULL;
if(autocvar_hud_cursormode)
setcursormode(1);
}
panel_pos_y += hud_fontsize_y*2;
- HUD_MinigameMenu_activeitem = world;
+ HUD_MinigameMenu_activeitem = NULL;
vector sz;
- for ( e = HUD_MinigameMenu_entries; e != world; e = e.list_next )
+ for ( e = HUD_MinigameMenu_entries; e != NULL; e = e.list_next )
{
sz = eX*panel_size_x + eY*e.size_y;
if ( e.model )
vector offset;
float itemh;
vector imgsz = '22 22 0'; // NOTE: if changed, edit where HUD_MinigameMenu_activeitem is selected
- for ( entity e = HUD_MinigameMenu_entries; e != world; e = e.list_next )
+ for ( entity e = HUD_MinigameMenu_entries; e != NULL; e = e.list_next )
{
color = e.colormod;
// find same game piece given its tile name
entity bd_find_piece(entity minig, string tile, bool check_target)
{
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minig) ) )
if ( e.classname == "minigame_board_piece" && e.netname == tile && ((check_target) ? e.bd_tiletype == BD_TILE_TARGET : e.bd_tiletype != BD_TILE_TARGET) )
return e;
- return world;
+ return NULL;
}
// check if the tile name is valid (15x15 grid)
entity bd_find_dozer(entity minig)
{
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minig) ) )
if ( e.classname == "minigame_board_piece" && e.bd_tiletype == BD_TILE_DOZER )
return e;
- return world;
+ return NULL;
}
void bd_check_winner(entity minig)
{
int total = 0, valid = 0;
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minig) ) )
if ( e.classname == "minigame_board_piece" && e.bd_tiletype == BD_TILE_TARGET )
{
int dy = bound(-1, dys, 1);
int moved = 0;
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minigame) ) )
if ( e.classname == "minigame_board_piece" && e.bd_tiletype == BD_TILE_DOZER )
{
#ifdef SVQC
for(e = minigame.minigame_players; e; e = e.list_next)
#elif defined(CSQC)
- e = world;
+ e = NULL;
while( (e = findentity(e,owner,minigame)) )
if ( e.classname == "minigame_player" )
#endif
void bd_load_level(entity minigame);
void bd_setup_pieces(entity minigame)
{
- entity e = world;
+ entity e = NULL;
while( (e = findentity(e, owner, minigame)) )
if(e.classname == "minigame_board_piece")
{
if(minigame.bd_levelname && minigame.bd_levelname != "")
{
int target_count = 0, boulder_count = 0;
- entity piece = world;
+ entity piece = NULL;
while((piece = findentity(piece,owner,minigame)))
if(piece.classname == "minigame_board_piece")
if(piece.bd_tiletype == BD_TILE_BOULDER)
if(minigame.bd_nextlevel && minigame.bd_nextlevel != "" && fexists(strcat("minigames/bulldozer/storage_", minigame.bd_nextlevel, ".txt")))
fputs(file_get, strcat("nextlevel = \"", minigame.bd_nextlevel, "\"\n"));
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minigame) ) )
if ( e.classname == "minigame_board_piece" )
{
}
case "end":
{
- entity e = world;
+ entity e = NULL;
while( (e = findentity(e, owner, minigame)) )
if(e.classname == "minigame_board_piece")
{
{
if(e.bd_tiletype == BD_TILE_TARGET)
{
- e.bd_enemy = world;
+ e.bd_enemy = NULL;
e.bd_enemy = bd_find_piece(active_minigame, e.netname, false);
}
else if(e.bd_tiletype == BD_TILE_BOULDER)
{
e.bd_hide = false; // reset either way
- e.bd_hide = ((bd_find_piece(active_minigame, e.netname, true)) != world);
+ e.bd_hide = ((bd_find_piece(active_minigame, e.netname, true)) != NULL);
}
}
}
// find connect 4 piece given its tile name
entity c4_find_piece(entity minig, string tile)
{
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minig) ) )
if ( e.classname == "minigame_board_piece" && e.netname == tile )
return e;
- return world;
+ return NULL;
}
// Checks if the given piece completes a row
}
case "end":
{
- entity e = world;
+ entity e = NULL;
while( (e = findentity(e, owner, minigame)) )
if(e.classname == "minigame_board_piece")
{
// Remove tiles of a NMM minigame
void nmm_kill_tiles(entity minig)
{
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minig) ) )
if ( e.classname == "minigame_nmm_tile" )
{
// Find a tile by its id
entity nmm_find_tile(entity minig, string id)
{
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minig) ) )
if ( e.classname == "minigame_nmm_tile" && e.netname == id )
return e;
- return world;
+ return NULL;
}
// Check whether two tiles are adjacent
// Returns 1 if there is at least 1 free adjacent tile
bool nmm_tile_canmove(entity tile)
{
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,tile.owner) ) )
if ( e.classname == "minigame_nmm_tile" && !e.nmm_tile_piece
&& nmm_tile_adjacent(e,tile) )
if ( e.classname == "minigame_board_piece" &&
(e.minigame_flags & pieceflags) && e.team == teamn )
return e;
- return world;
+ return NULL;
}
// Count NMM pieces matching flags and team number
int nmm_count_pieces(entity minigame, int teamn, int pieceflags)
{
int n = 0;
- entity e = world;
+ entity e = NULL;
while (( e = nmm_find_piece(e,minigame, teamn, pieceflags) ))
n++;
return n;
{
entity e = ...(0,entity);
int argc = ...(1,int);
- entity tile = world;
- entity piece = world;
+ entity tile = NULL;
+ entity piece = NULL;
bool move_ok = false;
if ( e && argc >= 2 && argv(0) == "move" &&
}
else if ( minigame.minigame_flags & NMM_TURN_PLACE )
{
- piece = nmm_find_piece(world,minigame,e.team,NMM_PIECE_HOME);
+ piece = nmm_find_piece(NULL,minigame,e.team,NMM_PIECE_HOME);
if ( !tile.nmm_tile_piece && piece )
{
tile.nmm_tile_piece = piece;
entity tile2 = nmm_find_tile(minigame,argv(2));
if ( tile2 && nmm_tile_adjacent(tile,tile2) && !tile2.nmm_tile_piece )
{
- tile.nmm_tile_piece = world;
+ tile.nmm_tile_piece = NULL;
tile2.nmm_tile_piece = piece;
piece.origin = tile2.origin;
piece.SendFlags |= MINIG_SF_UPDATE;
entity tile2 = nmm_find_tile(minigame,argv(2));
if ( tile2 && !tile2.nmm_tile_piece )
{
- tile.nmm_tile_piece = world;
+ tile.nmm_tile_piece = NULL;
tile2.nmm_tile_piece = piece;
piece.origin = tile2.origin;
piece.SendFlags |= MINIG_SF_UPDATE;
piece = tile.nmm_tile_piece;
if ( piece && piece.nmm_tile_piece.team != e.team )
{
- tile.nmm_tile_piece = world;
+ tile.nmm_tile_piece = NULL;
piece.minigame_flags = NMM_PIECE_DEAD;
piece.SendFlags |= MINIG_SF_UPDATE;
move_ok = true;
{
minigame.minigame_flags = NMM_TURN_TAKE|e.team;
int takemill = NMM_TURN_TAKEANY;
- entity f = world;
+ entity f = NULL;
while ( ( f = findentity(f,owner,minigame) ) )
if ( f.classname == "minigame_nmm_tile" && f.nmm_tile_piece &&
f.nmm_tile_piece.team == nextteam && !nmm_in_mill(f) )
}
else
{
- if ( nmm_find_piece(world,minigame,nextteam,NMM_PIECE_HOME) )
+ if ( nmm_find_piece(NULL,minigame,nextteam,NMM_PIECE_HOME) )
minigame.minigame_flags = NMM_TURN_PLACE|nextteam;
else if ( npieces == 3 )
minigame.minigame_flags = NMM_TURN_FLY|nextteam;
else
{
minigame.minigame_flags = NMM_TURN_WIN|e.team;
- entity f = world;
+ entity f = NULL;
while ( ( f = findentity(f,owner,minigame) ) )
if ( f.classname == "minigame_nmm_tile" && f.nmm_tile_piece &&
f.nmm_tile_piece.team == nextteam && nmm_tile_canmove(f) )
float piece_space = piece_sz_x + ( ts_x - 7 * piece_sz_x ) / 6;
vector mypos;
float piece_light = 1;
- entity e = world;
+ entity e = NULL;
mypos = pos;
if ( (active_minigame.minigame_flags&NMM_TURN_TEAM) == 2 )
if ( minigame.minigame_flags & (NMM_TURN_PLACE|NMM_TURN_TAKE) )
{
minigame_cmd("move ",nmm_currtile.netname);
- nmm_fromtile = world;
+ nmm_fromtile = NULL;
}
else if ( (minigame.minigame_flags & (NMM_TURN_MOVE|NMM_TURN_FLY)) )
{
if ( nmm_fromtile == nmm_currtile )
{
- nmm_fromtile = world;
+ nmm_fromtile = NULL;
}
else if ( nmm_currtile.nmm_tile_piece && nmm_currtile.nmm_tile_piece.team == minigame_self.team )
{
else if ( nmm_fromtile )
{
minigame_cmd("move ",nmm_fromtile.netname," ",nmm_currtile.netname);
- nmm_fromtile = world;
+ nmm_fromtile = NULL;
}
}
}
else
- nmm_fromtile = world;
+ nmm_fromtile = NULL;
}
string nmm_turn_to_string(int turnflags)
{
if ( event == "activate" )
{
- nmm_fromtile = world;
+ nmm_fromtile = NULL;
nmm_init_tiles(minigame);
minigame.message = nmm_turn_to_string(minigame.minigame_flags);
}
else if ( event == "deactivate" )
{
- nmm_fromtile = world;
+ nmm_fromtile = NULL;
nmm_kill_tiles(minigame);
}
else if ( event == "key_pressed" && (minigame.minigame_flags&NMM_TURN_TEAM) == minigame_self.team )
else
{
string tileid = nmm_currtile.netname;
- nmm_currtile = world;
+ nmm_currtile = NULL;
while ( !nmm_currtile )
{
tileid = minigame_relative_tile(tileid,1,0,7,7);
else
{
string tileid = nmm_currtile.netname;
- nmm_currtile = world;
+ nmm_currtile = NULL;
while ( !nmm_currtile )
{
tileid = minigame_relative_tile(tileid,-1,0,7,7);
else
{
string tileid = nmm_currtile.netname;
- nmm_currtile = world;
+ nmm_currtile = NULL;
while ( !nmm_currtile )
{
tileid = minigame_relative_tile(tileid,0,1,7,7);
else
{
string tileid = nmm_currtile.netname;
- nmm_currtile = world;
+ nmm_currtile = NULL;
while ( !nmm_currtile )
{
tileid = minigame_relative_tile(tileid,0,-1,7,7);
}
else if ( event == "mouse_moved" )
{
- nmm_currtile = world;
+ nmm_currtile = NULL;
vector tile_pos;
vector tile_size = minigame_hud_denormalize_size('1 1 0'/7,nmm_boardpos,nmm_boardsize);
entity e;
if ( e.classname == "minigame_nmm_tile" )
{
if ( e.nmm_tile_piece == sent )
- e.nmm_tile_piece = world;
+ e.nmm_tile_piece = NULL;
if ( e.netname == tileid )
e.nmm_tile_piece = sent;
}
float distance;
float next_distance;
float min_distance = 1;
- entity ball = world;
- entity mayball = world;
+ entity ball = NULL;
+ entity mayball = NULL;
while ( ( mayball = findentity(mayball,owner,this.owner) ) )
if ( mayball.classname == "pong_ball" )
{
}
// Spawns a pong paddle
-// if real_player is world, the paddle is controlled by AI
+// if real_player is NULL, the paddle is controlled by AI
entity pong_paddle_spawn(entity minigame, int pl_team, entity real_player)
{
entity paddle = msle_spawn(minigame,"pong_paddle");
paddle.mins = pong_team_to_box_halfsize(pl_team,-paddle.pong_length,-1/16);
paddle.maxs = pong_team_to_box_halfsize(pl_team,paddle.pong_length,1/16);
- if ( real_player == world )
+ if ( real_player == NULL )
pong_ai_spawn(paddle);
else
paddle.realowner = real_player;
int i;
for ( i = 0; i < PONG_MAX_PLAYERS; i++ )
{
- if ( minigame.pong_paddles[i] == world )
+ if ( minigame.pong_paddles[i] == NULL )
{
pong_paddle_spawn(minigame,i+1,player);
return i+1;
for ( i = 0; i < PONG_MAX_PLAYERS; i++ )
{
paddle = minigame.pong_paddles[i];
- if ( paddle != world && paddle.realowner == player )
+ if ( paddle != NULL && paddle.realowner == player )
{
ai = pong_ai_spawn(paddle);
ai.pong_score = player.minigame_players.pong_score;
if ( minigame.minigame_flags & PONG_STATUS_WAIT )
for ( i = 0; i < PONG_MAX_PLAYERS; i++ )
{
- if ( minigame.pong_paddles[i] == world )
+ if ( minigame.pong_paddles[i] == NULL )
{
- pong_paddle_spawn(minigame,i+1,world);
+ pong_paddle_spawn(minigame,i+1,NULL);
return true;
}
}
for ( i = PONG_MAX_PLAYERS-1; i >= 0; i-- )
{
paddle = minigame.pong_paddles[i];
- if ( paddle != world &&
+ if ( paddle != NULL &&
paddle.realowner.classname == "pong_ai" )
{
- minigame.pong_paddles[i] = world;
+ minigame.pong_paddles[i] = NULL;
remove(paddle.realowner);
remove(paddle);
return true;
// find tic tac toe piece given its tile name
entity pp_find_piece(entity minig, string tile)
{
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minig) ) )
if ( e.classname == "minigame_board_piece" && e.netname == tile )
return e;
- return world;
+ return NULL;
}
// check if the tile name is valid (3x3 grid)
}
}
- minigame.pp_curr_piece = world;
+ minigame.pp_curr_piece = NULL;
}
// request a new match
{
minigame.minigame_flags = PP_TURN_PLACE | minigame.pp_nexteam;
minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minigame) ) )
if ( e.classname == "minigame_board_piece" )
remove(e);
}
case "end":
{
- entity e = world;
+ entity e = NULL;
while( (e = findentity(e, owner, minigame)) )
if(e.classname == "minigame_board_piece")
{
vector tile_size = minigame_hud_denormalize_size('1 1 0'/PP_TILE_SIZE,pos,mySize);
vector tile_pos;
- active_minigame.pp_curr_piece = world;
+ active_minigame.pp_curr_piece = NULL;
entity e;
FOREACH_MINIGAME_ENTITY(e)
if(e.classname == "minigame_board_piece")
// find same game piece given its tile name
entity ps_find_piece(entity minig, string tile)
{
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minig) ) )
if ( e.classname == "minigame_board_piece" && e.netname == tile )
return e;
- return world;
+ return NULL;
}
bool ps_draw(entity minigame)
{
int valid = 0;
- entity e = world;
+ entity e = NULL;
while( ( e = findentity(e,owner,minigame) ) )
if( e.classname == "minigame_board_piece" )
{
//int number = minigame_tile_number(piece.netname);
//int letter = minigame_tile_letter(piece.netname);
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minigame) ) )
if ( e.classname == "minigame_board_piece" )
{
}
case "end":
{
- entity e = world;
+ entity e = NULL;
while( (e = findentity(e, owner, minigame)) )
if(e.classname == "minigame_board_piece")
{
else
{
minigame_cmd("move ", ps_curr_piece.netname, " ", ps_curr_pos);
- ps_curr_piece = world;
+ ps_curr_piece = NULL;
}
}
}
case "activate":
{
ps_set_curr_pos("");
- ps_curr_piece = world;
+ ps_curr_piece = NULL;
minigame.message = ps_turn_to_string(minigame.minigame_flags);
return false;
}
bool snake_alone(entity minig)
{
int headcount = 0;
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minig) ) )
if ( e.classname == "minigame_board_piece" && e.cnt == 1 )
++headcount;
// find same game piece given its tile name
entity snake_find_piece(entity minig, string tile)
{
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minig) ) )
if ( e.classname == "minigame_board_piece" && e.netname == tile )
return e;
- return world;
+ return NULL;
}
// find same game piece given its cnt
entity snake_find_cnt(entity minig, int steam, int tile)
{
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minig) ) )
if ( e.classname == "minigame_board_piece" && e.cnt == tile && e.team == steam )
return e;
- return world;
+ return NULL;
}
// check if the tile name is valid (15x15 grid)
entity snake_find_head(entity minig, int steam)
{
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minig) ) )
if ( e.classname == "minigame_board_piece" && e.cnt == 1 && e.team == steam )
return e;
- return world;
+ return NULL;
}
void snake_new_mouse(entity minigame)
{
string pos = minigame_tile_buildname(i, j);
if(!snake_find_piece(minigame, pos))
- RandomSelection_Add(world, 0, pos, 1, 1);
+ RandomSelection_Add(NULL, 0, pos, 1, 1);
}
entity piece = msle_spawn(minigame,"minigame_board_piece");
{
string pos = minigame_tile_buildname(i, j);
if(!snake_find_piece(minigame, pos))
- RandomSelection_Add(world, 0, pos, 1, 1);
+ RandomSelection_Add(NULL, 0, pos, 1, 1);
}
entity piece = msle_spawn(minigame,"minigame_board_piece");
piece.team = pteam;
piece.netname = strzone(RandomSelection_chosen_string);
piece.cnt = 1;
- piece.snake_next = world;
- piece.snake_prev = world;
+ piece.snake_next = NULL;
+ piece.snake_prev = NULL;
piece.snake_last = piece;
setthink(piece, snake_head_think);
piece.snake_delay = autocvar_sv_minigames_snake_delay_initial;
#ifdef SVQC
for(e = minigame.minigame_players; e; e = e.list_next)
#elif defined(CSQC)
- e = world;
+ e = NULL;
while( (e = findentity(e,owner,minigame)) )
if ( e.classname == "minigame_player" )
#endif
if(e.team == pteam)
return e;
- return world;
+ return NULL;
}
void snake_add_score(entity minigame, int pteam, int thescore)
piece.team = head.team;
piece.snake_prev = tail;
piece.snake_dir = tail.snake_dir;
- piece.snake_next = world;
+ piece.snake_next = NULL;
piece.snake_tail = true;
piece.netname = strzone(tail.netname);
head.nextthink = time + 1; // make sure they don't to eat us somehow
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minigame) ) )
if ( e.classname == "minigame_board_piece" && e.cnt && e.team == pteam )
{
}
case "end":
{
- entity e = world;
+ entity e = NULL;
while( (e = findentity(e, owner, minigame)) )
if(e.classname == "minigame_board_piece")
{
// find tic tac toe piece given its tile name
entity ttt_find_piece(entity minig, string tile)
{
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minig) ) )
if ( e.classname == "minigame_board_piece" && e.netname == tile )
return e;
- return world;
+ return NULL;
}
// Checks if the given piece completes a row
minigame.minigame_flags = TTT_TURN_PLACE | minigame.ttt_nexteam;
minigame_server_sendflags(minigame,MINIG_SF_UPDATE);
minigame.ttt_npieces = 0;
- entity e = world;
+ entity e = NULL;
while ( ( e = findentity(e,owner,minigame) ) )
if ( e.classname == "minigame_board_piece" )
remove(e);
}
case "end":
{
- entity e = world;
+ entity e = NULL;
while( (e = findentity(e, owner, minigame)) )
if(e.classname == "minigame_board_piece")
{
for ( int i = 0; i < 9; i++ )
{
if ( piecemask & f )
- RandomSelection_Add(world, f, string_null, 1, 1);
+ RandomSelection_Add(NULL, f, string_null, 1, 1);
f <<= 1;
}
{
if ( minigame.minigame_flags == (TTT_TURN_PLACE|minigame.ttt_ai) )
{
- entity aiplayer = world;
+ entity aiplayer = NULL;
while ( ( aiplayer = findentity(aiplayer,owner,minigame) ) )
if ( aiplayer.classname == "minigame_player" && !aiplayer.minigame_playerslot )
break;
#ifdef SVQC
for(e = minigame.minigame_players; e; e = e.list_next)
#elif defined(CSQC)
- e = world;
+ e = NULL;
while( (e = findentity(e,owner,minigame)) )
if ( e.classname == "minigame_player" )
#endif
void player_clear_minigame(entity player)
{
- player.active_minigame = world;
- player.minigame_players = world;
+ player.active_minigame = NULL;
+ player.minigame_players = NULL;
if ( IS_PLAYER(player) )
player.movetype = MOVETYPE_WALK;
else
if ( p.minigame_players == player )
{
- if ( p.list_next == world )
+ if ( p.list_next == NULL )
{
end_minigame(minigame_session);
return;
}
else
{
- for ( e = p.list_next; e != world; e = e.list_next )
+ for ( e = p.list_next; e != NULL; e = e.list_next )
{
if ( e.minigame_players == player )
{
void minigame_resend(entity minigame)
{
minigame.SendFlags = MINIG_SF_ALL;
- entity e = world;
+ entity e = NULL;
while (( e = findentity(e,owner,minigame) ))
{
e.SendFlags = MINIG_SF_ALL;
bool minigame_CheckSend(entity this)
{
entity e;
- for ( e = this.owner.minigame_players; e != world; e = e.list_next )
+ for ( e = this.owner.minigame_players; e != NULL; e = e.list_next )
if ( e.minigame_players == other )
return true;
return false;
entity start_minigame(entity player, string minigame )
{
if ( !autocvar_sv_minigames || !IS_REAL_CLIENT(player) )
- return world;
+ return NULL;
entity e = minigame_get_descriptor(minigame);
if ( e )
{
LOG_TRACE("Minigame ",minig.netname," rejected the first player join!\n");
end_minigame(minig);
- return world;
+ return NULL;
}
Net_LinkEntity(minig, false, 0, minigame_SendEntity);
return minig;
}
- return world;
+ return NULL;
}
entity join_minigame(entity player, string game_id )
{
if ( !autocvar_sv_minigames || !IS_REAL_CLIENT(player) )
- return world;
+ return NULL;
entity minig;
- for ( minig = minigame_sessions; minig != world; minig = minig.list_next )
+ for ( minig = minigame_sessions; minig != NULL; minig = minig.list_next )
{
if ( minig.netname == game_id )
if ( minigame_addplayer(minig,player) )
return minig;
}
- return world;
+ return NULL;
}
void part_minigame(entity player )
GameLogEcho(strcat(":minigame:end:",minigame_session.netname));
- entity e = world;
+ entity e = NULL;
while( (e = findentity(e, owner, minigame_session)) )
if ( e.minigame_autoclean )
{
}
entity p;
- for ( e = minigame_session.minigame_players; e != world; e = p )
+ for ( e = minigame_session.minigame_players; e != NULL; e = p )
{
p = e.list_next;
player_clear_minigame(e.minigame_players);
entity minigame_find_player(entity client)
{
if ( ! client.active_minigame )
- return world;
+ return NULL;
entity e;
for ( e = client.active_minigame.minigame_players; e; e = e.list_next )
if ( e.minigame_players == client )
return e;
- return world;
+ return NULL;
}
bool MinigameImpulse(entity this, int imp)
else if ( minig_cmd == "list-sessions" )
{
entity e;
- for ( e = minigame_sessions; e != world; e = e.list_next )
+ for ( e = minigame_sessions; e != NULL; e = e.list_next )
sprint(caller,e.netname,"\n");
return;
}
bool M_Mage_Defend_Heal_Check(entity this, entity targ)
{
- if(targ == world)
+ if(targ == NULL)
return false;
if(targ.health <= 0)
return false;
sound(this, CH_SHOTS, SND_GRENADE_IMPACT, VOL_BASE, ATTEN_NORM);
- this.realowner.mage_spike = world;
+ this.realowner.mage_spike = NULL;
Send_Effect(EFFECT_EXPLOSION_SMALL, this.origin, '0 0 0', 1);
- RadiusDamage (this, this.realowner, (autocvar_g_monster_mage_attack_spike_damage), (autocvar_g_monster_mage_attack_spike_damage) * 0.5, (autocvar_g_monster_mage_attack_spike_radius), world, world, 0, DEATH_MONSTER_MAGE.m_id, other);
+ RadiusDamage (this, this.realowner, (autocvar_g_monster_mage_attack_spike_damage), (autocvar_g_monster_mage_attack_spike_damage) * 0.5, (autocvar_g_monster_mage_attack_spike_radius), NULL, NULL, 0, DEATH_MONSTER_MAGE.m_id, other);
remove (this);
}
spd + (autocvar_g_monster_mage_attack_spike_accel) * frametime
);
- if (this.enemy != world)
+ if (this.enemy != NULL)
if (this.enemy.takedamage != DAMAGE_AIM || IS_DEAD(this.enemy))
- this.enemy = world;
+ this.enemy = NULL;
- if (this.enemy != world)
+ if (this.enemy != NULL)
{
entity e = this.enemy;
vector eorg = 0.5 * (e.absmin + e.absmax);
void M_Mage_Attack_Push(entity this)
{
sound(this, CH_SHOTS, SND_TAGEXP1, 1, ATTEN_NORM);
- RadiusDamage (this, this, (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_radius), world, world, (autocvar_g_monster_mage_attack_push_force), DEATH_MONSTER_MAGE.m_id, this.enemy);
+ RadiusDamage (this, this, (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_radius), NULL, NULL, (autocvar_g_monster_mage_attack_push_force), DEATH_MONSTER_MAGE.m_id, this.enemy);
Send_Effect(EFFECT_TE_EXPLOSION, this.origin, '0 0 0', 1);
setanim(this, this.anim_shoot, true, true, true);
if(this.movetype == MOVETYPE_NONE)
this.velocity = this.oldvelocity;
- RadiusDamage (this, this.realowner, (autocvar_g_monster_shambler_attack_lightning_damage), (autocvar_g_monster_shambler_attack_lightning_damage), (autocvar_g_monster_shambler_attack_lightning_radius), world, world, (autocvar_g_monster_shambler_attack_lightning_force), this.projectiledeathtype, other);
+ RadiusDamage (this, this.realowner, (autocvar_g_monster_shambler_attack_lightning_damage), (autocvar_g_monster_shambler_attack_lightning_damage), (autocvar_g_monster_shambler_attack_lightning_radius), NULL, NULL, (autocvar_g_monster_shambler_attack_lightning_force), this.projectiledeathtype, other);
for(head = findradius(this.origin, (autocvar_g_monster_shambler_attack_lightning_radius_zap)); head; head = head.chain) if(head != this.realowner) if(head.takedamage)
{
this.nextthink = time;
if (time > this.cnt)
{
- other = world;
+ other = NULL;
M_Shambler_Attack_Lightning_Explode(this);
return;
}
if(this)
{
Send_Effect(EFFECT_ELECTRO_IMPACT, this.origin, '0 0 0', 1);
- RadiusDamage(this, this.realowner, 0, 0, 25, world, world, 25, this.projectiledeathtype, world);
+ RadiusDamage(this, this.realowner, 0, 0, 25, NULL, NULL, 25, this.projectiledeathtype, NULL);
for(entity e = findradius(this.origin, 25); e; e = e.chain) if(e != this) if(e.takedamage && !IS_DEAD(e)) if(e.health > 0) if(e.monsterid != MON_SPIDER.monsterid)
e.spider_slowness = time + (autocvar_g_monster_spider_attack_web_damagetime);
entity own = this.realowner;
- RadiusDamage(this, own, autocvar_g_monster_wyvern_attack_fireball_damage, autocvar_g_monster_wyvern_attack_fireball_edgedamage, autocvar_g_monster_wyvern_attack_fireball_force, world, world, autocvar_g_monster_wyvern_attack_fireball_radius, this.projectiledeathtype, world);
+ RadiusDamage(this, own, autocvar_g_monster_wyvern_attack_fireball_damage, autocvar_g_monster_wyvern_attack_fireball_edgedamage, autocvar_g_monster_wyvern_attack_fireball_force, NULL, NULL, autocvar_g_monster_wyvern_attack_fireball_radius, this.projectiledeathtype, NULL);
FOREACH_ENTITY_FLOAT(takedamage, DAMAGE_AIM,
{
{
RandomSelection_Init();
for(i = MON_FIRST; i <= MON_LAST; ++i)
- RandomSelection_Add(world, i, string_null, 1, 1);
+ RandomSelection_Add(NULL, i, string_null, 1, 1);
monster_id = RandomSelection_chosen_float;
}
{
if(MUTATOR_CALLHOOK(MonsterFindTarget)) { return mon.enemy; } // Handled by a mutator
- entity head, closest_target = world;
+ entity head, closest_target = NULL;
head = findradius(mon.origin, mon.target_range);
while(head) // find the closest acceptable target to pass to
void Monster_Attack_Check(entity this, entity targ)
{
- if((this == world || targ == world)
+ if((this == NULL || targ == NULL)
|| (!this.monster_attackfunc)
|| (time < this.attack_finished_single[0])
) { return; }
void Monster_Touch(entity this)
{
- if(other == world) { return; }
+ if(other == NULL) { return; }
if(other.monster_attack)
if(this.enemy != other)
targ_origin = WarpZone_RefSys_TransformOrigin(this.enemy, this, targ_origin); // origin of target as seen by the monster (us)
WarpZone_TraceLine(this.origin, targ_origin, MOVE_NOMONSTERS, this);
- if((this.enemy == world)
+ if((this.enemy == NULL)
|| (IS_DEAD(this.enemy) || this.enemy.health < 1)
|| (STAT(FROZEN, this.enemy))
|| (this.enemy.flags & FL_NOTARGET)
|| (vdist(this.origin - targ_origin, >, this.target_range))
|| ((trace_fraction < 1) && (trace_ent != this.enemy)))
{
- this.enemy = world;
+ this.enemy = NULL;
this.pass_distance = 0;
}
if(this.enemy)
{
- /*WarpZone_TrailParticles(world, particleeffectnum(EFFECT_RED_PASS), this.origin, targ_origin);
+ /*WarpZone_TrailParticles(NULL, particleeffectnum(EFFECT_RED_PASS), this.origin, targ_origin);
print("Trace origin: ", vtos(targ_origin), "\n");
print("Target origin: ", vtos(this.enemy.origin), "\n");
print("My origin: ", vtos(this.origin), "\n"); */
void Monster_Move(entity this, float runspeed, float walkspeed, float stpspeed)
{
- if(this.target2) { this.goalentity = find(world, targetname, this.target2); }
+ if(this.target2) { this.goalentity = find(NULL, targetname, this.target2); }
entity targ;
movelib_brake_simple(this, stpspeed);
setanim(this, this.anim_idle, true, false, false);
- this.enemy = world;
+ this.enemy = NULL;
this.nextthink = time + this.ticrate;
if(this.revive_progress >= 1)
movelib_brake_simple(this, stpspeed);
setanim(this, this.anim_idle, true, false, false);
- this.enemy = world;
+ this.enemy = NULL;
this.nextthink = time + this.ticrate;
if(this.health < 1)
{
this.last_trace = time + 0.4;
- Damage (this, world, world, 2, DEATH_DROWN.m_id, this.origin, '0 0 0');
+ Damage (this, NULL, NULL, 2, DEATH_DROWN.m_id, this.origin, '0 0 0');
this.angles = '90 90 0';
if(random() < 0.5)
{
if (MUTATOR_CALLHOOK(MonsterMove, this, runspeed, walkspeed, targ)
|| gameover
- || this.draggedby != world
+ || this.draggedby != NULL
|| (round_handler_IsActive() && !round_handler_IsRoundStarted())
|| time < game_starttime
|| (autocvar_g_campaign && !campaign_bots_may_start)
if(teamplay)
if(autocvar_g_monsters_teams)
if(DIFF_TEAM(this.monster_follow, this))
- this.monster_follow = world;
+ this.monster_follow = NULL;
if(time >= this.last_enemycheck)
{
}
else
{
- entity e = find(world, targetname, this.target2);
+ entity e = find(NULL, targetname, this.target2);
if(e.target2)
this.target2 = e.target2;
else if(e.target)
this.health = this.max_health;
this.velocity = '0 0 0';
- this.enemy = world;
- this.goalentity = world;
+ this.enemy = NULL;
+ this.goalentity = NULL;
this.attack_finished_single[0] = 0;
this.moveto = this.origin;
}
this.solid = SOLID_CORPSE;
this.takedamage = DAMAGE_AIM;
this.deadflag = DEAD_DEAD;
- this.enemy = world;
+ this.enemy = NULL;
this.movetype = MOVETYPE_TOSS;
this.moveto = this.origin;
settouch(this, Monster_Touch); // reset incase monster was pouncing
if(time < this.spawnshieldtime && deathtype != DEATH_KILL.m_id)
return;
- if(deathtype == DEATH_FALL.m_id && this.draggedby != world)
+ if(deathtype == DEATH_FALL.m_id && this.draggedby != NULL)
return;
vector v;
// don't check for enemies, just keep walking in a straight line
void Monster_Move_2D(entity this, float mspeed, bool allow_jumpoff)
{
- if(gameover || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || this.draggedby != world || time < game_starttime || (autocvar_g_campaign && !campaign_bots_may_start) || time < this.spawn_time)
+ if(gameover || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || this.draggedby != NULL || time < game_starttime || (autocvar_g_campaign && !campaign_bots_may_start) || time < this.spawn_time)
{
mspeed = 0;
if(time >= this.spawn_time)
if(autocvar_g_monsters_healthbars)
{
- entity wp = WaypointSprite_Spawn(WP_Monster, 0, 1024, this, '0 0 1' * (this.maxs.z + 15), world, this.team, this, sprite, true, RADARICON_DANGER);
+ entity wp = WaypointSprite_Spawn(WP_Monster, 0, 1024, this, '0 0 1' * (this.maxs.z + 15), NULL, this.team, this, sprite, true, RADARICON_DANGER);
wp.wp_extra = this.monsterid;
wp.colormod = ((this.team) ? Team_ColorRGB(this.team) : '1 0 0');
if(!(this.spawnflags & MONSTERFLAG_INVINCIBLE))
this.solid = SOLID_BBOX;
this.movetype = MOVETYPE_WALK;
this.spawnshieldtime = time + autocvar_g_monsters_spawnshieldtime;
- this.enemy = world;
+ this.enemy = NULL;
this.velocity = '0 0 0';
this.moveto = this.origin;
this.pos1 = this.origin;
{
MUTATOR_ONADD
{
- InitializeEntity(world, buffs_DelayedInit, INITPRIO_FINDTARGET);
+ InitializeEntity(NULL, buffs_DelayedInit, INITPRIO_FINDTARGET);
}
}
void buff_Waypoint_Spawn(entity e)
{
entity buff = buff_FirstFromFlags(e.buffs);
- entity wp = WaypointSprite_Spawn(WP_Buff, 0, autocvar_g_buffs_waypoint_distance, e, '0 0 1' * e.maxs.z, world, e.team, e, buff_waypoint, true, RADARICON_Buff);
+ entity wp = WaypointSprite_Spawn(WP_Buff, 0, autocvar_g_buffs_waypoint_distance, e, '0 0 1' * e.maxs.z, NULL, e.team, e, buff_waypoint, true, RADARICON_Buff);
wp.wp_extra = buff.m_id;
WaypointSprite_UpdateTeamRadar(e.buff_waypoint, RADARICON_Buff, e.glowmod);
e.buff_waypoint.waypointsprite_visible_for_player = buff_Waypoint_visible_for_player;
{
int buffid = buff_FirstFromFlags(other.buffs).m_id;
//Send_Notification(NOTIF_ONE, other, MSG_MULTI, ITEM_BUFF_DROP, other.buffs);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ITEM_BUFF_LOST, other.netname, buffid);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ITEM_BUFF_LOST, other.netname, buffid);
other.buffs = 0;
//sound(other, CH_TRIGGER, SND_BUFF_LOST, VOL_BASE, ATTN_NORM);
FOREACH(Buffs, buff_Available(it), LAMBDA(
it.buff_seencount += 1;
// if it's already been chosen, give it a lower priority
- RandomSelection_Add(world, it.m_itemid, string_null, 1, max(0.2, 1 / it.buff_seencount));
+ RandomSelection_Add(NULL, it.m_itemid, string_null, 1, max(0.2, 1 / it.buff_seencount));
));
ent.buffs = RandomSelection_chosen_float;
}
if(!this.owner || STAT(FROZEN, this.owner) || IS_DEAD(this.owner) || !this.owner.iscreature || !(this.owner.buffs & this.buffs))
{
buff_SetCooldown(this, autocvar_g_buffs_cooldown_respawn + frametime);
- this.owner = world;
+ this.owner = NULL;
if(autocvar_g_buffs_randomize)
buff_NewType(this, this.buffs);
{
if(autocvar_g_buffs_randomize)
buff_NewType(this, this.buffs);
- this.owner = world;
+ this.owner = NULL;
buff_SetCooldown(this, autocvar_g_buffs_cooldown_activate);
buff_Waypoint_Reset(this);
this.buff_activetime_updated = false;
if(frag_target.buff_model)
{
remove(frag_target.buff_model);
- frag_target.buff_model = world;
+ frag_target.buff_model = NULL;
}
}
}
if(player.buffs & BUFF_SWAPPER.m_itemid)
{
float best_distance = autocvar_g_buffs_swapper_range;
- entity closest = world;
+ entity closest = NULL;
FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
if(!IS_DEAD(it) && !STAT(FROZEN, it) && !it.vehicle)
if(DIFF_TEAM(it, player))
if(player.buff_model)
{
remove(player.buff_model);
- player.buff_model = world;
+ player.buff_model = NULL;
}
// also reset timers here to prevent them continuing after spectating
else
{
remove(player.buff_model);
- player.buff_model = world;
+ player.buff_model = NULL;
player.effects &= ~(EF_NOSHADOW);
}
void buffs_DelayedInit(entity this)
{
if(autocvar_g_buffs_spawn_count > 0)
- if(find(world, classname, "item_buff") == world)
+ if(find(NULL, classname, "item_buff") == NULL)
{
float i;
for(i = 0; i < autocvar_g_buffs_spawn_count; ++i)
{
Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CAMPCHECK);
if(player.vehicle)
- Damage(player.vehicle, world, world, autocvar_g_campcheck_damage * 2, DEATH_CAMP.m_id, player.vehicle.origin, '0 0 0');
+ Damage(player.vehicle, NULL, NULL, autocvar_g_campcheck_damage * 2, DEATH_CAMP.m_id, player.vehicle.origin, '0 0 0');
else
- Damage(player, world, world, bound(0, autocvar_g_campcheck_damage, player.health + player.armorvalue * autocvar_g_balance_armor_blockpercent + 5), DEATH_CAMP.m_id, player.origin, '0 0 0');
+ Damage(player, NULL, NULL, bound(0, autocvar_g_campcheck_damage, player.health + player.armorvalue * autocvar_g_balance_armor_blockpercent + 5), DEATH_CAMP.m_id, player.origin, '0 0 0');
}
player.campcheck_nextcheck = time + autocvar_g_campcheck_interval;
player.campcheck_traveled_distance = 0;
player.alpha = autocvar_g_instagib_invis_alpha;
player.exteriorweaponentity.alpha = autocvar_g_instagib_invis_alpha;
player.items |= ITEM_Invisibility.m_itemid;
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_INVISIBILITY, player.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERUP_INVISIBILITY, player.netname);
Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_POWERUP_INVISIBILITY);
}
}
if (time < player.invincible_finished)
{
player.items |= ITEM_Speed.m_itemid;
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_SPEED, player.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERUP_SPEED, player.netname);
Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_POWERUP_SPEED);
}
}
sound(this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
RadiusDamage(this, this.realowner, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage,
- autocvar_g_nades_nade_radius, this, world, autocvar_g_nades_nade_force, this.projectiledeathtype, this.enemy);
+ autocvar_g_nades_nade_radius, this, NULL, autocvar_g_nades_nade_force, this.projectiledeathtype, this.enemy);
Damage_DamageInfo(this.origin, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage,
autocvar_g_nades_nade_radius, '1 1 1' * autocvar_g_nades_nade_force, this.projectiledeathtype, 0, this);
}
if(this.realowner.nade_spawnloc)
{
remove(this.realowner.nade_spawnloc);
- this.realowner.nade_spawnloc = world;
+ this.realowner.nade_spawnloc = NULL;
}
this.realowner.nade_spawnloc = spawnloc;
if(nade_blast)
{
RadiusDamage(this, this.realowner, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage,
- autocvar_g_nades_nade_radius, this, world, autocvar_g_nades_nade_force, this.projectiledeathtype, this.enemy);
+ autocvar_g_nades_nade_radius, this, NULL, autocvar_g_nades_nade_force, this.projectiledeathtype, this.enemy);
Damage_DamageInfo(this.origin, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage, autocvar_g_nades_nade_radius, '1 1 1' * autocvar_g_nades_nade_force, this.projectiledeathtype, 0, this);
}
void toss_nade(entity e, bool set_owner, vector _velocity, float _time)
{
- if(e.nade == world)
+ if(e.nade == NULL)
return;
entity _nade = e.nade;
- e.nade = world;
+ e.nade = NULL;
remove(e.fake_nade);
- e.fake_nade = world;
+ e.fake_nade = NULL;
makevectors(e.v_angle);
setorigin(_nade, w_shotorg + offset + (v_right * 25) * -1);
//setmodel(_nade, MDL_PROJECTILE_NADE);
- //setattachment(_nade, world, "");
+ //setattachment(_nade, NULL, "");
PROJECTILE_MAKETRIGGER(_nade);
if(STAT(NADES_SMALL, e))
setsize(_nade, '-8 -8 -8', '8 8 8');
_nade.takedamage = DAMAGE_AIM;
_nade.event_damage = nade_damage;
setcefc(_nade, func_null);
- _nade.exteriormodeltoclient = world;
+ _nade.exteriormodeltoclient = NULL;
_nade.traileffectnum = 0;
_nade.teleportable = true;
_nade.pushable = true;
if(player.fake_nade)
remove(player.fake_nade);
- player.nade = player.fake_nade = world;
+ player.nade = player.fake_nade = NULL;
player.nade_timer = 0;
}
}
float n = 0;
- entity o = world;
+ entity o = NULL;
if(player.freezetag_frozen_timeout > 0 && time >= player.freezetag_frozen_timeout)
n = -1;
else
if(player.nade_spawnloc.cnt <= 0)
{
remove(player.nade_spawnloc);
- player.nade_spawnloc = world;
+ player.nade_spawnloc = NULL;
}
}
}
Send_Effect(EFFECT_ICEORGLASS, frag_target.origin, '0 0 0', 3);
M_ARGV(4, float) = 0;
M_ARGV(6, vector) = '0 0 0';
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED_NADE, frag_target.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED_NADE, frag_target.netname);
Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_FREEZETAG_REVIVE_SELF);
}
}
RandomSelection_Init();
FOREACH(Weapons, it != WEP_Null, LAMBDA(
if(NIX_CanChooseWeapon(it.m_id))
- RandomSelection_Add(world, it.m_id, string_null, 1, (it.m_id != nix_weapon));
+ RandomSelection_Add(NULL, it.m_id, string_null, 1, (it.m_id != nix_weapon));
));
nix_nextweapon = RandomSelection_chosen_float;
}
this.event_damage = func_null;
this.takedamage = DAMAGE_NO;
- RadiusDamage (this, this.realowner, WEP_CVAR(rpc, damage), WEP_CVAR(rpc, edgedamage), WEP_CVAR(rpc, radius), world, world, WEP_CVAR(rpc, force), this.projectiledeathtype, other);
+ RadiusDamage (this, this.realowner, WEP_CVAR(rpc, damage), WEP_CVAR(rpc, edgedamage), WEP_CVAR(rpc, radius), NULL, NULL, WEP_CVAR(rpc, force), this.projectiledeathtype, other);
remove (this);
}
{
entity item = M_ARGV(0, entity);
- if(item.owner == world && autocvar_g_physical_items <= 1)
+ if(item.owner == NULL && autocvar_g_physical_items <= 1)
return;
if (item.spawnflags & 1) // floating item
return;
wep.glowmod = item.owner.glowmod;
wep.damageforcescale = autocvar_g_physical_items_damageforcescale;
wep.dphitcontentsmask = item.dphitcontentsmask;
- wep.cnt = (item.owner != world);
+ wep.cnt = (item.owner != NULL);
setthink(wep, physical_item_think);
wep.nextthink = time;
this.realowner = it;
break;
}
- this.realowner = world;
+ this.realowner = NULL;
));
this.nextthink = time;
.float old_solid, old_movetype;
entity sandbox_ObjectEdit_Get(entity this, float permissions)
{
- // Returns the traced entity if the player can edit it, and world if not.
+ // Returns the traced entity if the player can edit it, and NULL if not.
// If permissions if false, the object is returned regardless of editing rights.
// Attached objects are SOLID_NOT and do not get traced.
crosshair_trace_plusvisibletriggers(this);
if(vdist(this.origin - trace_ent.origin, >, autocvar_g_sandbox_editor_distance_edit))
- return world; // out of trace range
+ return NULL; // out of trace range
if(trace_ent.classname != "object")
- return world; // entity is not an object
+ return NULL; // entity is not an object
if(!permissions)
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 (!(trace_ent.realowner != this && 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;
+ return NULL;
}
void sandbox_ObjectEdit_Scale(entity e, float f)
// detaches any object attached to e
entity head;
- for(head = world; (head = find(head, classname, "object")); )
+ for(head = NULL; (head = find(head, classname, "object")); )
{
if(head.owner == e)
{
vector org;
org = gettaginfo(head, 0);
- setattachment(head, world, "");
- head.owner = world;
+ setattachment(head, NULL, "");
+ head.owner = NULL;
// objects change origin and angles when detached, so apply previous position
setorigin(head, org);
sandbox_ObjectAttach_Remove(e); // detach child objects
// if the object being removed has been selected for attachment by a player, unset it
- FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && it.object_attach == e, LAMBDA(it.object_attach = world));
+ FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && it.object_attach == e, LAMBDA(it.object_attach = NULL));
if(e.material) { strunzone(e.material); e.material = string_null; }
if(e.crypto_idfp) { strunzone(e.crypto_idfp); e.crypto_idfp = string_null; }
if(e.message) { strunzone(e.message); e.message = string_null; }
if(e.message2) { strunzone(e.message2); e.message2 = string_null; }
remove(e);
- e = world;
+ e = NULL;
object_count -= 1;
}
string s;
entity head;
- for(head = world; (head = find(head, classname, "object")); )
+ for(head = NULL; (head = find(head, classname, "object")); )
{
// the main object needs to be first in the array [0] with attached objects following
float slot, physics, solidity;
{
// load object properties, and spawn a new object with them
float n, i;
- entity e = world, parent = world;
+ entity e = NULL, parent = NULL;
// separate objects between the ; symbols
n = tokenizebyseparator(s, "; ");
fputs(file_get, strcat("// sandbox storage \"", autocvar_g_sandbox_storage_name, "\" for map \"", GetMapname(), "\" last updated ", strftime(true, "%d-%m-%Y %H:%M:%S")));
fputs(file_get, strcat(" containing ", ftos(object_count), " objects\n"));
- for(head = world; (head = find(head, classname, "object")); )
+ for(head = NULL; (head = find(head, classname, "object")); )
{
// attached objects are persisted separately, ignore them here
- if(head.owner != world)
+ if(head.owner != NULL)
continue;
// use a line of text for each object, listing all properties
// ---------------- COMMAND: OBJECT, REMOVE ----------------
case "object_remove":
e = sandbox_ObjectEdit_Get(player, true);
- if(e != world)
+ if(e != NULL)
{
if(autocvar_g_sandbox_info > 0)
LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " removed an object at origin ^3", vtos(e.origin), "\n"));
case "copy":
// copies customizable properties of the selected object to the clipboard cvar
e = sandbox_ObjectEdit_Get(player, autocvar_g_sandbox_editor_free); // can we copy objects we can't edit?
- if(e != world)
+ if(e != NULL)
{
s = sandbox_ObjectPort_Save(e, false);
s = strreplace("\"", "\\\"", s);
case "get":
// select e as the object as meant to be attached
e = sandbox_ObjectEdit_Get(player, true);
- if(e != world)
+ if(e != NULL)
{
player.object_attach = e;
print_to(player, "^2SANDBOX - INFO: ^7Object selected for attachment");
print_to(player, "^1SANDBOX - WARNING: ^7Object could not be selected for attachment. Make sure you are facing an object that you have edit rights over");
return true;
case "set":
- if(player.object_attach == world)
+ if(player.object_attach == NULL)
{
print_to(player, "^1SANDBOX - WARNING: ^7No object selected for attachment. Please select an object to be attached first.");
return true;
// attaches the previously selected object to e
e = sandbox_ObjectEdit_Get(player, true);
- if(e != world)
+ if(e != NULL)
{
sandbox_ObjectAttach_Set(player.object_attach, e, argv(3));
- player.object_attach = world; // object was attached, no longer keep it scheduled for attachment
+ player.object_attach = NULL; // object was attached, no longer keep it scheduled for attachment
print_to(player, "^2SANDBOX - INFO: ^7Object attached successfully");
if(autocvar_g_sandbox_info > 1)
LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " attached objects at origin ^3", vtos(e.origin), "\n"));
case "remove":
// removes e if it was attached
e = sandbox_ObjectEdit_Get(player, true);
- if(e != world)
+ if(e != NULL)
{
sandbox_ObjectAttach_Remove(e);
print_to(player, "^2SANDBOX - INFO: ^7Child objects detached successfully");
}
e = sandbox_ObjectEdit_Get(player, true);
- if(e != world)
+ if(e != NULL)
{
switch(argv(2))
{
return true;
}
e = sandbox_ObjectEdit_Get(player, true);
- if(e != world)
+ if(e != NULL)
{
// update the owner's name
// Do this before checking if you're already the owner and skipping if such, so we
case "object_info":
// prints public information about the object to the player
e = sandbox_ObjectEdit_Get(player, false);
- if(e != world)
+ if(e != NULL)
{
switch(argv(2))
{
s = "";
entity head;
i = 0;
- for(head = world; (head = find(head, classname, "object")); )
+ for(head = NULL; (head = find(head, classname, "object")); )
{
if(head.owner == e)
{
if(autocvar_g_spawn_near_teammate_ignore_spawnpoint == 1 || (autocvar_g_spawn_near_teammate_ignore_spawnpoint == 2 && player.cvar_cl_spawn_near_teammate))
return;
- spawn_spot.msnt_lookat = world;
+ spawn_spot.msnt_lookat = NULL;
if(!teamplay)
return;
if(autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay_death)
player.msnt_timer = time + autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay_death;
- entity best_mate = world;
+ entity best_mate = NULL;
vector best_spot = '0 0 0';
float pc = 0, best_dist = 0, dist = 0;
FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
entity e = spawn();
setorigin(e, org);
- RadiusDamage(e, world, autocvar_g_touchexplode_damage, autocvar_g_touchexplode_edgedamage, autocvar_g_touchexplode_radius, world, world, autocvar_g_touchexplode_force, DEATH_TOUCHEXPLODE.m_id, world);
+ RadiusDamage(e, NULL, autocvar_g_touchexplode_damage, autocvar_g_touchexplode_edgedamage, autocvar_g_touchexplode_radius, NULL, NULL, autocvar_g_touchexplode_force, DEATH_TOUCHEXPLODE.m_id, NULL);
remove(e);
}
void WaypointSprite_Kill(entity wp)
{
if (!wp) return;
- if (wp.owner) wp.owner.(wp.owned_by_field) = world;
+ if (wp.owner) wp.owner.(wp.owned_by_field) = NULL;
remove(wp);
}
if (wp.owner)
{
if (wp.exteriormodeltoclient == wp.owner)
- wp.exteriormodeltoclient = world;
- wp.owner.(wp.owned_by_field) = world;
- wp.owner = world;
+ wp.exteriormodeltoclient = NULL;
+ wp.owner.(wp.owned_by_field) = NULL;
+ wp.owner = NULL;
WaypointSprite_FadeOutIn(wp, fadetime);
}
if (IS_SPEC(e)) e = e.enemy;
/* TODO idea (check this breaks nothing)
else if (e.classname == "observer")
- e = world;
+ e = NULL;
*/
return e;
}
entity icon // initial icon
)
{
- return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, own, ownfield, true, icon);
+ return WaypointSprite_Spawn(spr, 0, 0, NULL, ofs, NULL, 0, own, ownfield, true, icon);
}
entity WaypointSprite_DeployFixed(
maxdistance = waypointsprite_limitedrange;
else
maxdistance = 0;
- return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, world, ofs, world, t, player, waypointsprite_deployed_fixed, false, icon);
+ return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, NULL, ofs, NULL, t, player, waypointsprite_deployed_fixed, false, icon);
}
entity WaypointSprite_DeployPersonal(
entity icon // initial icon
)
{
- return WaypointSprite_Spawn(spr, 0, 0, world, ofs, world, 0, player, waypointsprite_deployed_personal, false, icon);
+ return WaypointSprite_Spawn(spr, 0, 0, NULL, ofs, NULL, 0, player, waypointsprite_deployed_personal, false, icon);
}
entity WaypointSprite_Attach(
{
float t;
if (player.waypointsprite_attachedforcarrier)
- return world; // can't attach to FC
+ return NULL; // can't attach to FC
if (teamplay)
t = player.team;
else
maxdistance = waypointsprite_limitedrange;
else
maxdistance = 0;
- return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, player, '0 0 64', world, t, player, waypointsprite_attached, false, icon);
+ return WaypointSprite_Spawn(spr, waypointsprite_deployed_lifetime, maxdistance, player, '0 0 64', NULL, t, player, waypointsprite_attached, false, icon);
}
entity WaypointSprite_AttachCarrier(
)
{
WaypointSprite_Kill(carrier.waypointsprite_attached); // FC overrides attached
- entity e = WaypointSprite_Spawn(spr, 0, 0, carrier, '0 0 64', world, carrier.team, carrier, waypointsprite_attachedforcarrier, false, icon);
+ entity e = WaypointSprite_Spawn(spr, 0, 0, carrier, '0 0 64', NULL, carrier.team, carrier, waypointsprite_attachedforcarrier, false, icon);
if (carrier.health)
{
WaypointSprite_UpdateMaxHealth(e, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id) * 2);
case NOTIF_ALL:
{
if (client) {
- return "Entity provided when world was required!";
+ return "Entity provided when NULL was required!";
}
break;
}
#ifdef NOTIFICATIONS_DEBUG
Debug_Notification(sprintf(
(
- "Local_Notification_sound(world, %f, '%s', %f, %f) "
+ "Local_Notification_sound(NULL, %f, '%s', %f, %f) "
"^1BLOCKED BY ANTISPAM:^7 prevsnd: '%s', timediff: %f, limit: %f\n"
),
soundchannel,
ARG_CASE(ARG_DC, "item_centime", ftos(autocvar_notification_item_centerprinttime)) \
ARG_CASE(ARG_SV, "death_team", Team_ColoredFullName(f1)) \
ARG_CASE(ARG_CS, "death_team", Team_ColoredFullName(f1 - 1)) \
- ARG_CASE(ARG_CS_SV_HA, "minigame1_name",find(world,netname,s1).descriptor.message) \
- ARG_CASE(ARG_CS_SV_HA, "minigame1_d", find(world,netname,s1).descriptor.netname)
+ ARG_CASE(ARG_CS_SV_HA, "minigame1_name",find(NULL,netname,s1).descriptor.message) \
+ ARG_CASE(ARG_CS_SV_HA, "minigame1_d", find(NULL,netname,s1).descriptor.netname)
#define NOTIF_HIT_MAX(count,funcname) MACRO_BEGIN { \
if(sel_num == count) { backtrace(sprintf("%s: Hit maximum arguments!\n", funcname)); break; } \
if(!trace_ent)
{
//dprint("_Movetype_FlyMove: !trace_ent\n");
- trace_ent = world;
+ trace_ent = NULL;
}
this.move_flags |= FL_ONGROUND;
{
this.move_nextthink = 0;
this.move_time = time;
- other = world;
+ other = NULL;
this.move_think(this);
}
}
}
else if (this.move_suspendedinair && wasfreed(this.move_groundentity))
{
- this.move_groundentity = world;
+ this.move_groundentity = NULL;
return;
}
}
else if(IS_BOT_CLIENT(e))
{ s = sprintf("bot#%g#%s", skill, e.cleanname); }
- if((s == "") || find(world, playerstats_id, s)) // already have one of the ID - next one can't be tracked then!
+ if((s == "") || find(NULL, playerstats_id, s)) // already have one of the ID - next one can't be tracked then!
{
if(IS_BOT_CLIENT(e))
{ s = sprintf("bot#%d", e.playerid); }
autocvar_g_playerstats_gamereport_uri,
FILE_APPEND,
PlayerStats_GameReport_Handler,
- world
+ NULL
);
}
else
autocvar_g_playerstats_playerdetail_uri,
FILE_APPEND,
PlayerStats_PlayerDetail_Handler,
- world
+ NULL
);
PlayerStats_PlayerDetail_Status = PS_D_STATUS_WAITING;
//uri = strcat(uri, "/player/", uri_escape(crypto_getmyidfp(0)));
uri = strcat(uri, "/player/me");
print("Retrieving playerstats from URL: ", uri, "\n");
- url_single_fopen(uri, FILE_APPEND, PlayerInfo_ready, world);
+ url_single_fopen(uri, FILE_APPEND, PlayerInfo_ready, NULL);
}
}
#endif
void play2(entity e, string filename)
{
msg_entity = e;
- soundtoat(MSG_ONE, world, '0 0 0', CH_INFO, filename, VOL_BASE, ATTEN_NONE);
+ soundtoat(MSG_ONE, NULL, '0 0 0', CH_INFO, filename, VOL_BASE, ATTEN_NONE);
}
.float spamtime;
void play2all(string samp)
{
if (autocvar_bot_sound_monopoly) return;
- _sound(world, CH_INFO, samp, VOL_BASE, ATTEN_NONE);
+ _sound(NULL, CH_INFO, samp, VOL_BASE, ATTEN_NONE);
}
#endif
{
entity wi = Weapons_from(this.weapon);
if (wi != WEP_Null) {
- entity wp = WaypointSprite_Spawn(WP_Weapon, 0, 0, this, '0 0 64', world, 0, this, waypointsprite_attached, true, RADARICON_Weapon);
+ entity wp = WaypointSprite_Spawn(WP_Weapon, 0, 0, this, '0 0 64', NULL, 0, this, waypointsprite_attached, true, RADARICON_Weapon);
wp.wp_extra = wi.m_id;
break;
}
{
entity ii = this.itemdef;
if (ii != NULL) {
- entity wp = WaypointSprite_Spawn(WP_Item, 0, 0, this, '0 0 64', world, 0, this, waypointsprite_attached, true, RADARICON_Item);
+ entity wp = WaypointSprite_Spawn(WP_Item, 0, 0, this, '0 0 64', NULL, 0, this, waypointsprite_attached, true, RADARICON_Item);
wp.wp_extra = ii.m_id;
break;
}
if(this.team)
{
RandomSelection_Init();
- for(entity head = world; (head = findfloat(head, team, this.team)); )
+ for(entity head = NULL; (head = findfloat(head, team, this.team)); )
{
if(head.flags & FL_ITEM)
if(head.classname != "item_flag_team" && head.classname != "item_key_team")
string oldmsg;
entity act = this.owner;
- this.owner = world; // set by W_PrepareExplosionByDamage
+ this.owner = NULL; // set by W_PrepareExplosionByDamage
// now throw around the debris
n = tokenize_console(this.debris);
_sound (this, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM);
if(this.dmg)
- RadiusDamage(this, act, this.dmg, this.dmg_edge, this.dmg_radius, this, world, this.dmg_force, DEATH_HURTTRIGGER.m_id, world);
+ RadiusDamage(this, act, this.dmg, this.dmg_edge, this.dmg_radius, this, NULL, this.dmg_force, DEATH_HURTTRIGGER.m_id, NULL);
if(this.cnt) // TODO
__pointparticles(this.cnt, this.absmin * 0.5 + this.absmax * 0.5, '0 0 0', this.count);
entity e;
// set mythis as current conveyor where possible
- for(e = world; (e = findentity(e, conveyor, this)); )
- e.conveyor = world;
+ for(e = NULL; (e = findentity(e, conveyor, this)); )
+ e.conveyor = NULL;
if(this.state)
{
e.conveyor = this;
}
- for(e = world; (e = findentity(e, conveyor, this)); )
+ for(e = NULL; (e = findentity(e, conveyor, this)); )
{
if(IS_CLIENT(e)) // doing it via velocity has quite some advantages
continue; // done in SV_PlayerPhysics continue;
{
LOG_TRACE(" ", etos(t));
t.owner = this;
- if(t.enemy == world)
+ if(t.enemy == NULL)
{
t.enemy = this;
break;
p.x += random() * sz.x;
p.y += random() * sz.y;
p.z += random() * sz.z;
- if(WarpZoneLib_BoxTouchesBrush(p, p, this, world))
+ if(WarpZoneLib_BoxTouchesBrush(p, p, this, NULL))
{
if(this.movedir != '0 0 0')
{
- traceline(p, p + normalize(this.movedir) * 4096, 0, world);
+ traceline(p, p + normalize(this.movedir) * 4096, 0, NULL);
p = trace_endpos;
int eff_num;
if(this.cnt)
void train_wait(entity this)
{
SUB_UseTargets(this.enemy, NULL, NULL);
- this.enemy = world;
+ this.enemy = NULL;
// if turning is enabled, the train will turn toward the next point while waiting
if(this.platmovetype_turn && !this.train_wait_turning)
{
entity targ, cp;
vector ang;
- targ = find(world, targetname, this.target);
+ targ = find(NULL, targetname, this.target);
if((this.spawnflags & 1) && targ.curvetarget)
- cp = find(world, targetname, targ.curvetarget);
+ cp = find(NULL, targetname, targ.curvetarget);
else
- cp = world;
+ cp = NULL;
if(cp) // bezier curves movement
ang = cp.origin - (this.origin - this.view_ofs); // use the origin of the control point of the next path_corner
#endif
#ifdef SVQC
- entity tg = find(world, targetname, this.target);
+ entity tg = find(NULL, targetname, this.target);
if(tg.spawnflags & 4)
{
this.use = train_use;
void train_next(entity this)
{
- entity targ, cp = world;
+ entity targ, cp = NULL;
vector cp_org = '0 0 0';
- targ = find(world, targetname, this.target);
+ targ = find(NULL, targetname, this.target);
this.target = targ.target;
if (this.spawnflags & 1)
{
if(targ.curvetarget)
{
- cp = find(world, targetname, targ.curvetarget); // get its second target (the control point)
+ cp = find(NULL, targetname, targ.curvetarget); // get its second target (the control point)
cp_org = cp.origin - this.view_ofs; // no control point found, assume a straight line to the destination
}
}
void func_train_find(entity this)
{
entity targ;
- targ = find(world, targetname, this.target);
+ targ = find(NULL, targetname, this.target);
this.target = targ.target;
if (this.target == "")
objerror(this, "func_train_find: no next target");
void func_vectormamamam_findtarget(entity this)
{
if(this.target != "")
- this.wp00 = find(world, targetname, this.target);
+ this.wp00 = find(NULL, targetname, this.target);
if(this.target2 != "")
- this.wp01 = find(world, targetname, this.target2);
+ this.wp01 = find(NULL, targetname, this.target2);
if(this.target3 != "")
- this.wp02 = find(world, targetname, this.target3);
+ this.wp02 = find(NULL, targetname, this.target3);
if(this.target4 != "")
- this.wp03 = find(world, targetname, this.target4);
+ this.wp03 = find(NULL, targetname, this.target4);
if(!this.wp00 && !this.wp01 && !this.wp02 && !this.wp03)
objerror(this, "No reference entity found, so there is nothing to move. Aborting.");
void follow_init(entity this)
{
entity src, dst;
- src = world;
- dst = world;
+ src = NULL;
+ dst = NULL;
if(this.killtarget != "")
- src = find(world, targetname, this.killtarget);
+ src = find(NULL, targetname, this.killtarget);
if(this.target != "")
- dst = find(world, targetname, this.target);
+ dst = find(NULL, targetname, this.target);
if(!src && !dst)
{
void misc_laser_init(entity this)
{
if(this.target != "")
- this.enemy = find(world, targetname, this.target);
+ this.enemy = find(NULL, targetname, this.target);
}
.entity pusher;
}
void TargetMusic_RestoreGame()
{
- for(entity e = world; (e = find(e, classname, "target_music")); )
+ for(entity e = NULL; (e = find(e, classname, "target_music")); )
{
if(e.targetname == "")
target_music_sendto(e, MSG_INIT, 1);
it.lastvol = vol;
}
});
- music_trigger = world;
+ music_trigger = NULL;
bgmtime = (best) ? getsoundtime(best, CH_BGM_SINGLE) : gettime(GETTIME_CDTRACK);
}
void Ent_TriggerMusic_Think(entity this)
{
- if(WarpZoneLib_BoxTouchesBrush(view_origin, view_origin, this, world))
+ if(WarpZoneLib_BoxTouchesBrush(view_origin, view_origin, this, NULL))
{
music_trigger = this;
}
if(time < act.pushltime)
valueent = act.pusher;
else
- valueent = world;
+ valueent = NULL;
value = "";
}
else if(value == "target")
}
else if(value == "time")
{
- valueent = world;
+ valueent = NULL;
value = ftos(time);
}
else
this,
e,
this.message,
- find(world, targetname, this.killtarget),
- find(world, targetname, this.target2),
- find(world, targetname, this.target3),
- find(world, targetname, this.target4),
+ find(NULL, targetname, this.killtarget),
+ find(NULL, targetname, this.target2),
+ find(NULL, targetname, this.target3),
+ find(NULL, targetname, this.target4),
actor,
trigger
);
return true;
++c; // increase count to not include MYSELF
- for(e = world; (e = findfloat(e, target_spawn_id, this.target_spawn_id)); --c)
+ for(e = NULL; (e = findfloat(e, target_spawn_id, this.target_spawn_id)); --c)
;
// if c now is 0, we have AT LEAST the given count (maybe more), so don't spawn any more
else
{
// edit entity
- for(entity e = world; (e = find(e, targetname, this.target)); )
+ for(entity e = NULL; (e = find(e, targetname, this.target)); )
target_spawn_useon(e, this, actor, trigger);
}
}
void target_voicescript_clear(entity pl)
{
- pl.voicescript = world;
+ pl.voicescript = NULL;
}
void target_voicescript_use(entity this, entity actor, entity trigger)
}
else
{
- pl.voicescript = world; // stop trying then
+ pl.voicescript = NULL; // stop trying then
}
}
}
else
{
RandomSelection_Init();
- for(e = world; (e = find(e, targetname, teleporter.target)); )
+ for(e = NULL; (e = find(e, targetname, teleporter.target)); )
{
p = 1;
if(STAT(TELEPORT_TELEFRAG_AVOID, player))
{
int n = 0;
entity e;
- for(e = world; (e = find(e, targetname, this.target)); )
+ for(e = NULL; (e = find(e, targetname, this.target)); )
{
++n;
#ifdef SVQC
else
{
// have to use random selection every single time
- this.enemy = world;
+ this.enemy = NULL;
}
// now enable touch
entity Teleport_Find(vector mi, vector ma)
{
entity e;
- for(e = world; (e = find(e, classname, "trigger_teleport")); )
- if(WarpZoneLib_BoxTouchesBrush(mi, ma, e, world))
+ for(e = NULL; (e = find(e, classname, "trigger_teleport")); )
+ if(WarpZoneLib_BoxTouchesBrush(mi, ma, e, NULL))
return e;
- return world;
+ return NULL;
}
void WarpZone_PostTeleportPlayer_Callback(entity pl)
if(!(pl.move_flags & BIT(15))) // FL_PROJECTILE
#endif
LOG_INFO("A non-projectile got through a warpzone and its owner cleared. It's a ", pl.classname, ".\n");
- pl.owner = world;
+ pl.owner = NULL;
}
if(IS_PLAYER(pl))
{
{
int a = 0, b = 0;
- for(entity e = world; (e = find(e, targetname, this.target)); )
+ for(entity e = NULL; (e = find(e, targetname, this.target)); )
{
if(e.use == SUB_UseTargets)
{
}
else
backtrace("Removing a trigger_gravity_check with no valid owner");
- own.trigger_gravity_check = world;
+ own.trigger_gravity_check = NULL;
}
void trigger_gravity_check_think(entity this)
{
if(IS_PLAYER(actor))
this.enemy = actor;
else
- this.enemy = world; // let's just destroy it, if taking over is too much work
+ this.enemy = NULL; // let's just destroy it, if taking over is too much work
}
.float triggerhurttime;
if (!IS_PLAYER(own))
{
own = this;
- this.enemy = world; // I still hate you all
+ this.enemy = NULL; // I still hate you all
}
Damage (other, this, own, this.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0');
EXACTTRIGGER_TOUCH;
- targ = find(world, targetname, this.target);
+ targ = find(NULL, targetname, this.target);
if(!targ)
{
objerror(this, "trigger_force without a (valid) .target!\n");
{
entity e;
RandomSelection_Init();
- for(e = world; (e = find(e, targetname, this.target)); )
+ for(e = NULL; (e = find(e, targetname, this.target)); )
{
if(e.cnt)
RandomSelection_Add(e, 0, string_null, e.cnt, 1);
if (this.target)
{
float n = 0;
- for(t = world; (t = find(t, targetname, this.target)); )
+ for(t = NULL; (t = find(t, targetname, this.target)); )
{
++n;
#ifdef SVQC
else if(n == 1)
{
// exactly one dest - bots love that
- this.enemy = find(world, targetname, this.target);
+ this.enemy = find(NULL, targetname, this.target);
}
else
{
// have to use random selection every single time
- this.enemy = world;
+ this.enemy = NULL;
}
}
#ifdef SVQC
*/
void trigger_keylock_trigger(entity this, entity actor, string s)
{
- for(entity t = world; (t = find(t, targetname, s)); )
+ for(entity t = NULL; (t = find(t, targetname, s)); )
if(t.use)
t.use(t, actor, this);
}
void trigger_keylock_kill(string s)
{
entity t;
- for(t = world; (t = find(t, targetname, s)); )
+ for(t = NULL; (t = find(t, targetname, s)); )
remove(t);
}
#ifdef SVQC
void relay_activators_use(entity this, entity actor, entity trigger)
{
- for(entity trg = world; (trg = find(trg, targetname, this.target)); )
+ for(entity trg = NULL; (trg = find(trg, targetname, this.target)); )
{
if (trg.setactive)
trg.setactive(trg, this.cnt);
// we abuse this method, rather than using normal .touch, because touch isn't reliable with multiple clients inside the same trigger, and can't "untouch" entities
// set myself as current viewloc where possible
- for(e = world; (e = findentity(e, viewloc, this)); )
- e.viewloc = world;
+ for(e = NULL; (e = findentity(e, viewloc, this)); )
+ e.viewloc = NULL;
for(e = findradius((this.absmin + this.absmax) * 0.5, vlen(this.absmax - this.absmin) * 0.5 + 1); e; e = e.chain)
if(!e.viewloc)
void viewloc_init(entity this)
{
entity e;
- for(e = world; (e = find(e, targetname, this.target)); )
+ for(e = NULL; (e = find(e, targetname, this.target)); )
if(e.classname == "target_viewlocation_start")
{
this.enemy = e;
break;
}
- for(e = world; (e = find(e, targetname, this.target2)); )
+ for(e = NULL; (e = find(e, targetname, this.target2)); )
if(e.classname == "target_viewlocation_end")
{
this.goalentity = e;
void trigger_viewloc_updatelink(entity this)
{
- this.enemy = findfloat(world, entnum, this.cnt);
- this.goalentity = findfloat(world, entnum, this.count);
+ this.enemy = findfloat(NULL, entnum, this.cnt);
+ this.goalentity = findfloat(NULL, entnum, this.count);
}
NET_HANDLE(ENT_CLIENT_VIEWLOC_TRIGGER, bool isnew)
float point1 = ReadShort();
float point2 = ReadShort();
- this.enemy = findfloat(world, entnum, point1);
- this.goalentity = findfloat(world, entnum, point2);
+ this.enemy = findfloat(NULL, entnum, point1);
+ this.goalentity = findfloat(NULL, entnum, point2);
this.origin_x = ReadCoord();
this.origin_y = ReadCoord();
s = this.killtarget;
if (s != "")
{
- for(entity t = world; (t = find(t, targetname, s)); )
+ for(entity t = NULL; (t = find(t, targetname, s)); )
remove(t);
}
#endif
// Flag to set func_clientwall state
// 1 == deactivate, 2 == activate, 0 == do nothing
int aw_flag = this.antiwall_flag;
- for(entity t = world; (t = find(t, targetname, s)); )
+ for(entity t = NULL; (t = find(t, targetname, s)); )
{
if(t.use)
{
if(this.target != "")
{
- this.enemy = find(world, targetname, this.target);
- if(this.enemy == world)
+ this.enemy = find(NULL, targetname, this.target);
+ if(this.enemy == NULL)
LOG_TRACE("A turret_checkpoint faild to find its target!\n");
}
//setthink(this, turret_checkpoint_think);
{
remove(this.tur_head);
//remove(this.enemy);
- this.tur_head = world;
+ this.tur_head = NULL;
}
.vector glowmod;
{
entity tur = get_turretinfo(this.m_id);
- if(this.tur_head == world)
+ if(this.tur_head == NULL)
this.tur_head = spawn();
this.netname = tur.turret_name;
{
entity gib;
- traceline(_from, _to, MOVE_NOMONSTERS, world);
+ traceline(_from, _to, MOVE_NOMONSTERS, NULL);
if(trace_startsolid)
- return world;
+ return NULL;
gib = new(turret_gib);
setorigin(gib, _from);
if(sf & TNSF_ANG)
{
- if(this.tur_head == world) // aparenly this can happpen before TNSF_SETUP. great.
+ if(this.tur_head == NULL) // aparenly this can happpen before TNSF_SETUP. great.
this.tur_head = spawn();
this.tur_head.move_angles_x = ReadShort();
if(sf & TNSF_AVEL)
{
- if(this.tur_head == world) // aparenly this can happpen before TNSF_SETUP. great.
+ if(this.tur_head == NULL) // aparenly this can happpen before TNSF_SETUP. great.
this.tur_head = spawn();
this.tur_head.move_avelocity_x = ReadShort();
it.tr_config(it);
// step 3: sort queue
- heapsort(TUR_CONFIG_COUNT, T_Config_Queue_Swap, T_Config_Queue_Compare, world);
+ heapsort(TUR_CONFIG_COUNT, T_Config_Queue_Swap, T_Config_Queue_Compare, NULL);
// step 4: write queue
TUR_CONFIG_WRITETOFILE(sprintf("// {{{ #%d: %s\n", i, it.turret_name))
this.health = 0;
// Go boom
- //RadiusDamage (this,this, min(this.ammo,50),min(this.ammo,50) * 0.25,250,world,min(this.ammo,50)*5,DEATH_TURRET,world);
+ //RadiusDamage (this,this, min(this.ammo,50),min(this.ammo,50) * 0.25,250,NULL,min(this.ammo,50)*5,DEATH_TURRET,NULL);
Turret tur = get_turretinfo(this.m_id);
if(this.damage_flags & TFL_DMG_DEATH_NORESPAWN)
this.tur_head.avelocity = this.avelocity;
this.tur_head.angles = this.idle_aim;
this.health = this.max_health;
- this.enemy = world;
+ this.enemy = NULL;
this.volly_counter = this.shot_volly;
this.ammo = this.ammo_max;
string unitname = ent.netname;
string sbase;
- if (ent == world)
+ if (ent == NULL)
return;
if(!ent.turret_scale_damage) ent.turret_scale_damage = 1;
sbase = strcat(cvar_base,unitname);
if (is_reload)
{
- ent.enemy = world;
+ ent.enemy = NULL;
ent.tur_head.avelocity = '0 0 0';
ent.tur_head.angles = '0 0 0';
this.event_damage = func_null;
#ifdef TURRET_DEBUG
float d;
- d = RadiusDamage (this, this.owner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, world, this.owner.shot_force, this.totalfrags, world);
+ d = RadiusDamage (this, this.owner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.totalfrags, NULL);
this.owner.tur_debug_dmg_t_h = this.owner.tur_debug_dmg_t_h + d;
this.owner.tur_debug_dmg_t_f = this.owner.tur_debug_dmg_t_f + this.owner.shot_dmg;
#else
- RadiusDamage (this, this.realowner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, world, this.owner.shot_force, this.totalfrags, world);
+ RadiusDamage (this, this.realowner, this.owner.shot_dmg, 0, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.totalfrags, NULL);
#endif
remove(this);
}
if(!this.active)
target_angle = this.idle_aim - ('1 0 0' * this.aim_maxpitch);
- else if (this.enemy == world)
+ else if (this.enemy == NULL)
{
if(time > this.lip)
target_angle = this.idle_aim + this.angles;
m_score = this.turret_score_target(this,e_enemy) * this.target_select_samebias;
}
else
- e_enemy = this.enemy = world;
+ e_enemy = this.enemy = NULL;
e = findradius(this.origin, this.target_range);
// Nothing to aim at?
if (!e)
- return world;
+ return NULL;
while (e)
{
if (this.firecheck_flags & TFL_FIRECHECK_NO)
return true;
- if (this.enemy == world)
+ if (this.enemy == NULL)
return false;
// Ready?
this.volly_counter = this.shot_volly;
if (this.shoot_flags & TFL_SHOOT_CLEARTARGET)
- this.enemy = world;
+ this.enemy = NULL;
if (this.shot_volly > 1)
this.attack_finished_single[0] = time + this.shot_volly_refire;
e = e.chain;
}
- this.enemy = world;
+ this.enemy = NULL;
}
else if(this.shoot_flags & TFL_SHOOT_CUSTOM)
{
if(this.target_validate_time < time)
if (turret_validate_target(this, this.enemy, this.target_validate_flags) <= 0)
{
- this.enemy = world;
+ this.enemy = NULL;
this.target_validate_time = time + 0.5;
do_target_scan = 1;
}
}
// No target, just go to idle, do any custom stuff and bail.
- if (this.enemy == world)
+ if (this.enemy == NULL)
{
// Turn & pitch
if(!(this.track_flags & TFL_TRACK_NO))
/*
When .used a turret switch team to activator.team.
- If activator is world, the turret go inactive.
+ If activator is NULL, the turret go inactive.
*/
void turret_use(entity this, entity actor, entity trigger)
{
tur.tr_precache(tur);
}
- entity e = find(world, classname, "turret_manager");
+ entity e = find(NULL, classname, "turret_manager");
if(!e)
{
e = new(turret_manager);
if(!this.tur_defend)
if(this.target != "")
{
- this.tur_defend = find(world, targetname, this.target);
- if (this.tur_defend == world)
+ this.tur_defend = find(NULL, targetname, this.target);
+ if (this.tur_defend == NULL)
{
this.target = "";
LOG_TRACE("Turret has invalid defendpoint!\n");
#ifdef EWHEEL_FANCYPATH
// Are we close enougth to a path node to switch to the next?
if(vdist(this.origin - this.pathcurrent.origin, <, 64))
- if (this.pathcurrent.path_next == world)
+ if (this.pathcurrent.path_next == NULL)
{
// Path endpoint reached
pathlib_deletepath(this.pathcurrent.owner);
- this.pathcurrent = world;
+ this.pathcurrent = NULL;
if (this.pathgoal)
{
}
}
else
- this.pathgoal = world;
+ this.pathgoal = NULL;
}
else
this.pathcurrent = this.pathcurrent.path_next;
if(it.movetype == MOVETYPE_WALK)
{
it.velocity = '0 0 0';
- it.enemy = world;
+ it.enemy = NULL;
setorigin(it, it.pos1);
if (it.target != "")
{
- e = find(world, targetname, it.target);
+ e = find(NULL, targetname, it.target);
if (!e)
{
LOG_TRACE("Initital waypoint for ewheel does NOT exsist, fix your map!\n");
void turret_flac_projectile_think_explode(entity this)
{
- if(this.enemy != world)
+ if(this.enemy != NULL)
if(vdist(this.origin - this.enemy.origin, <, this.owner.shot_radius * 3))
setorigin(this, this.enemy.origin + randomvec() * this.owner.shot_radius);
#ifdef TURRET_DEBUG
- float d = RadiusDamage (this, this.owner, this.owner.shot_dmg, this.owner.shot_dmg, this.owner.shot_radius, this, world, this.owner.shot_force, this.totalfrags, world);
+ float d = RadiusDamage (this, this.owner, this.owner.shot_dmg, this.owner.shot_dmg, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.totalfrags, NULL);
this.owner.tur_dbg_dmg_t_h = this.owner.tur_dbg_dmg_t_h + d;
this.owner.tur_dbg_dmg_t_f = this.owner.tur_dbg_dmg_t_f + this.owner.shot_dmg;
#else
- RadiusDamage (this, this.realowner, this.owner.shot_dmg, this.owner.shot_dmg, this.owner.shot_radius, this, world, this.owner.shot_force, this.totalfrags, world);
+ RadiusDamage (this, this.realowner, this.owner.shot_dmg, this.owner.shot_dmg, this.owner.shot_radius, this, NULL, this.owner.shot_force, this.totalfrags, NULL);
#endif
remove(this);
}
if (IS_DEAD(this.enemy))
return false;
- if (this.enemy == world)
+ if (this.enemy == NULL)
return false;
if (this.ammo < this.shot_dmg)
turret_projectile_explode(this);
// Enemy dead? just keep on the current heading then.
- if ((this.enemy == world) || (IS_DEAD(this.enemy)))
+ if ((this.enemy == NULL) || (IS_DEAD(this.enemy)))
{
// Make sure we dont return to tracking a respawned player
- this.enemy = world;
+ this.enemy = NULL;
// Turn model
this.angles = vectoangles(this.velocity);
// turret_hk_missile_explode();
if (IS_DEAD(this.enemy))
- this.enemy = world;
+ this.enemy = NULL;
// Pick the closest valid target.
if (!this.enemy)
fe = 0;
}
- if ((fe != 1) || (this.enemy == world) || (edist > 1000))
+ if ((fe != 1) || (this.enemy == NULL) || (edist > 1000))
{
myspeed = vlen(this.velocity);
//if(this.atime < time) {
if ((fe <= 0.99)||(edist > 1000))
{
- te_lightning2(world,this.origin, this.origin + vr * lt_seek);
- te_lightning2(world,this.origin, this.origin + vl * lt_seek);
- te_lightning2(world,this.origin, this.origin + vu * lt_seek);
- te_lightning2(world,this.origin, this.origin + vd * lt_seek);
- te_lightning2(world,this.origin, vf);
+ te_lightning2(NULL,this.origin, this.origin + vr * lt_seek);
+ te_lightning2(NULL,this.origin, this.origin + vl * lt_seek);
+ te_lightning2(NULL,this.origin, this.origin + vu * lt_seek);
+ te_lightning2(NULL,this.origin, this.origin + vd * lt_seek);
+ te_lightning2(NULL,this.origin, vf);
}
else
{
- te_lightning2(world,this.origin, this.enemy.origin);
+ te_lightning2(NULL,this.origin, this.enemy.origin);
}
bprint("Speed: ", ftos(rint(myspeed)), "\n");
bprint("Trace to solid: ", ftos(rint(ff * 100)), "%\n");
bool hk_is_valid_target(entity this, entity e_target)
{
- if (e_target == world)
+ if (e_target == NULL)
return false;
// If only this was used more..
// teamcolor / hit beam effect
vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
- WarpZone_TrailParticles(world, particleeffectnum(EFFECT_VAPORIZER(it.team)), it.tur_shotorg, v);
+ WarpZone_TrailParticles(NULL, particleeffectnum(EFFECT_VAPORIZER(it.team)), it.tur_shotorg, v);
}
else
{
// teamcolor / hit beam effect
vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
- WarpZone_TrailParticles(world, particleeffectnum(EFFECT_VAPORIZER(it.team)), it.tur_shotorg, v);
+ WarpZone_TrailParticles(NULL, particleeffectnum(EFFECT_VAPORIZER(it.team)), it.tur_shotorg, v);
} else {
SUPER(PlasmaTurret).tr_attack(thistur, it);
}
if(this.target_validate_time < time)
if (turret_validate_target(this, this.enemy, this.target_validate_flags) <= 0)
{
- this.enemy = world;
+ this.enemy = NULL;
this.target_validate_time = time + 0.5;
do_target_scan = 1;
}
d *= 0.75;
r *= 0.85;
t = toast(actor, t, r, d);
- if (t == world) break;
+ if (t == NULL) break;
}
entity toast(entity actor, entity from, float range, float damage)
{
entity e;
- entity etarget = world;
+ entity etarget = NULL;
float d,dd;
float r;
}
void walker_rocket_explode(entity this)
{
- RadiusDamage (this, this.owner, (autocvar_g_turrets_unit_walker_rocket_damage), 0, (autocvar_g_turrets_unit_walker_rocket_radius), this, world, (autocvar_g_turrets_unit_walker_rocket_force), DEATH_TURRET_WALK_ROCKET.m_id, world);
+ RadiusDamage (this, this.owner, (autocvar_g_turrets_unit_walker_rocket_damage), 0, (autocvar_g_turrets_unit_walker_rocket_radius), this, NULL, (autocvar_g_turrets_unit_walker_rocket_force), DEATH_TURRET_WALK_ROCKET.m_id, NULL);
remove (this);
}
m_speed = vlen(this.velocity);
// Enemy dead? just keep on the current heading then.
- if (this.enemy == world || IS_DEAD(this.enemy))
- this.enemy = world;
+ if (this.enemy == NULL || IS_DEAD(this.enemy))
+ this.enemy = NULL;
if (this.enemy)
{
#ifdef WALKER_FANCYPATHING
// Are we close enougth to a path node to switch to the next?
if(vdist(this.origin - this.pathcurrent.origin, <, 64))
- if (this.pathcurrent.path_next == world)
+ if (this.pathcurrent.path_next == NULL)
{
// Path endpoint reached
pathlib_deletepath(this.pathcurrent.owner);
- this.pathcurrent = world;
+ this.pathcurrent = NULL;
if (this.pathgoal)
{
}
}
else
- this.pathgoal = world;
+ this.pathgoal = NULL;
}
else
this.pathcurrent = this.pathcurrent.path_next;
if (it.spawnflags & TSF_NO_PATHBREAK && it.pathcurrent)
walker_move_path(it);
- else if (it.enemy == world)
+ else if (it.enemy == NULL)
{
if(it.pathcurrent)
walker_move_path(it);
if (it.target != "")
{
- e = find(world, targetname, it.target);
+ e = find(NULL, targetname, it.target);
if (!e)
{
LOG_TRACE("Initital waypoint for walker does NOT exsist, fix your map!\n");
{
tracebox(start, smin, smax, end, false, this);
- // if it is world we can't hurt it so stop now
- if (trace_ent == world || trace_fraction == 1)
+ // if it is NULL we can't hurt it so stop now
+ if (trace_ent == NULL || trace_fraction == 1)
break;
if (trace_ent.solid == SOLID_BSP)
endpoint = trace_endpos;
// find all the entities the railgun hit and restore their solid state
- ent = findfloat(world, railgunhit, true);
+ ent = findfloat(NULL, railgunhit, true);
while (ent)
{
// restore their solid type
}
// find all the entities the railgun hit and hurt them
- ent = findfloat(world, railgunhit, true);
+ ent = findfloat(NULL, railgunhit, true);
while (ent)
{
// get the details we need to call the damage function
'0 1 0' * ma.y + '0 0 1' * ma.z,
'1 0 0' * ma.x,
MOVE_WORLDONLY,
- world);
+ NULL);
if(!trace_startsolid)
mi_min.x = trace_endpos.x;
'1 0 0' * ma.x + '0 0 1' * ma.z,
'0 1 0' * ma.y,
MOVE_WORLDONLY,
- world);
+ NULL);
if(!trace_startsolid)
mi_min.y = trace_endpos.y;
'1 0 0' * ma.x + '0 1 0' * ma.y,
'0 0 1' * ma.z,
MOVE_WORLDONLY,
- world);
+ NULL);
if(!trace_startsolid)
mi_min.z = trace_endpos.z;
'0 1 0' * ma.y + '0 0 1' * ma.z,
'1 0 0' * mi.x,
MOVE_WORLDONLY,
- world);
+ NULL);
if(!trace_startsolid)
mi_max.x = trace_endpos.x;
'1 0 0' * ma.x + '0 0 1' * ma.z,
'0 1 0' * mi.y,
MOVE_WORLDONLY,
- world);
+ NULL);
if(!trace_startsolid)
mi_max.y = trace_endpos.y;
'1 0 0' * ma.x + '0 1 0' * ma.y,
'0 0 1' * mi.z,
MOVE_WORLDONLY,
- world);
+ NULL);
if(!trace_startsolid)
mi_max.z = trace_endpos.z;
}
});
#else
- entity e = world;
+ entity e = NULL;
while((e = find(e, classname, "saved_cvar_value")))
{
if(cvar_type(e.netname))
// start with a 1-element queue
queue_start = queue_end = e;
- queue_end.(fld) = world;
+ queue_end.(fld) = NULL;
queue_end.FindConnectedComponent_processing = 1;
// for each queued item:
{
// find all neighbors of queue_start
entity t;
- for(t = world; (t = nxt(t, queue_start, pass)); )
+ for(t = NULL; (t = nxt(t, queue_start, pass)); )
{
if(t.FindConnectedComponent_processing)
continue;
// it is connected? ADD IT. It will look for neighbors soon too.
queue_end.(fld) = t;
queue_end = t;
- queue_end.(fld) = world;
+ queue_end.(fld) = NULL;
queue_end.FindConnectedComponent_processing = 1;
}
}
int axh_id = bound(0, ReadByte(), MAX_AXH);
entity axh = AuxiliaryXhair[axh_id];
- if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
+ if(axh == NULL || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
{
axh = spawn();
axh.draw2d = func_null;
{
entity axh = AuxiliaryXhair[i];
- if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
+ if(axh != NULL && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
remove(axh);
axh = spawn();
if(alarm1time < time)
{
alarm1time = time + 2;
- vehicle_alarm(world, CH_PAIN_SINGLE, SND_VEH_ALARM);
+ vehicle_alarm(NULL, CH_PAIN_SINGLE, SND_VEH_ALARM);
}
drawpic_skin(tmpPos, "vehicle_icon_health", tmpSize, '1 1 1', hudAlpha * blinkValue, DRAWFLAG_NORMAL);
}
{
if(alarm1time)
{
- vehicle_alarm(world, CH_PAIN_SINGLE, SND_Null);
+ vehicle_alarm(NULL, CH_PAIN_SINGLE, SND_Null);
alarm1time = 0;
}
drawpic_skin(tmpPos, "vehicle_icon_health", tmpSize, '1 1 1', hudAlpha, DRAWFLAG_NORMAL);
if(alarm2time < time)
{
alarm2time = time + 1;
- vehicle_alarm(world, CH_TRIGGER_SINGLE, SND_VEH_ALARM_SHIELD);
+ vehicle_alarm(NULL, CH_TRIGGER_SINGLE, SND_VEH_ALARM_SHIELD);
}
drawpic_skin(tmpPos, "vehicle_icon_shield", tmpSize, '1 1 1', hudAlpha * blinkValue, DRAWFLAG_NORMAL);
}
{
if(alarm2time)
{
- vehicle_alarm(world, CH_TRIGGER_SINGLE, SND_Null);
+ vehicle_alarm(NULL, CH_TRIGGER_SINGLE, SND_Null);
alarm2time = 0;
}
drawpic_skin(tmpPos, "vehicle_icon_shield", tmpSize, '1 1 1', hudAlpha, DRAWFLAG_NORMAL);
axh_id = bound(0, axh_id, MAX_AXH);
axh = own.(AuxiliaryXhair[axh_id]);
- if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
+ if(axh == NULL || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
{
axh = spawn();
axh.cnt = axh_id;
{
if(this.lock_target && IS_DEAD(this.lock_target))
{
- this.lock_target = world;
+ this.lock_target = NULL;
this.lock_strength = 0;
this.lock_time = 0;
}
return;
}
- if(trace_ent != world)
+ if(trace_ent != NULL)
{
if(SAME_TEAM(trace_ent, this))
- trace_ent = world;
+ trace_ent = NULL;
if(IS_DEAD(trace_ent))
- trace_ent = world;
+ trace_ent = NULL;
if(!(IS_VEHICLE(trace_ent) || IS_TURRET(trace_ent)))
- trace_ent = world;
+ trace_ent = NULL;
if(trace_ent.alpha <= 0.5 && trace_ent.alpha != 0)
- trace_ent = world; // invisible
+ trace_ent = NULL; // invisible
}
- if(this.lock_target == world && trace_ent != world)
+ if(this.lock_target == NULL && trace_ent != NULL)
this.lock_target = trace_ent;
if(this.lock_target && trace_ent == this.lock_target)
// Have a locking target
// Trace hit current target
- if(trace_ent == this.lock_target && trace_ent != world)
+ if(trace_ent == this.lock_target && trace_ent != NULL)
{
this.lock_strength = min(this.lock_strength + incr, 1);
if(this.lock_strength == 1)
this.lock_strength = max(this.lock_strength - decr, 0);
if(this.lock_strength == 0)
- this.lock_target = world;
+ this.lock_target = NULL;
}
}
void vehicles_projectile_explode(entity this)
{
- if(this.owner && other != world)
+ if(this.owner && other != NULL)
{
if(other == this.owner.vehicle)
return;
PROJECTILE_TOUCH(this);
this.event_damage = func_null;
- RadiusDamage (this, this.realowner, this.shot_dmg, 0, this.shot_radius, this, world, this.shot_force, this.totalfrags, other);
+ RadiusDamage (this, this.realowner, this.shot_dmg, 0, this.shot_radius, this, NULL, this.shot_force, this.totalfrags, other);
remove (this);
}
rgb = Team_ColorRGB(ent.team);
else
rgb = '1 1 1';
- entity wp = WaypointSprite_Spawn(WP_Vehicle, 0, 0, ent, '0 0 64', world, 0, ent, waypointsprite_attached, true, RADARICON_Vehicle);
+ entity wp = WaypointSprite_Spawn(WP_Vehicle, 0, 0, ent, '0 0 64', NULL, 0, ent, waypointsprite_attached, true, RADARICON_Vehicle);
wp.colormod = rgb;
if(ent.waypointsprite_attached)
{
if((this.vehicle_flags & VHF_HASSHIELD) && (this.vehicle_shield > 0))
{
- if (wasfreed(this.vehicle_shieldent) || this.vehicle_shieldent == world)
+ if (wasfreed(this.vehicle_shieldent) || this.vehicle_shieldent == NULL)
{
this.vehicle_shieldent = spawn();
this.vehicle_shieldent.effects = EF_LOWPRECISION;
if(_minspeed < wc)
{
float take = min(_speedfac * wc, _maxpain);
- Damage (this, world, world, take, DEATH_FALL.m_id, this.origin, '0 0 0');
+ Damage (this, NULL, NULL, take, DEATH_FALL.m_id, this.origin, '0 0 0');
this.play_time = time + 0.25;
//dprint("wc: ", ftos(wc), "\n");
player.teleportable = TELEPORT_NORMAL;
player.alpha = 1;
player.PlayerPhysplug = func_null;
- player.vehicle = world;
+ player.vehicle = NULL;
player.view_ofs = STAT(PL_VIEW_OFS, NULL);
player.event_damage = PlayerDamage;
player.hud = HUD_NORMAL;
if(!IS_DEAD(vehic))
vehic.avelocity = '0 0 0';
- vehic.tur_head.nodrawtoclient = world;
+ vehic.tur_head.nodrawtoclient = NULL;
if(!teamplay)
vehic.team = 0;
vehicles_setreturn(vehic);
vehicles_reset_colors(vehic);
- vehic.owner = world;
+ vehic.owner = NULL;
CSQCMODEL_AUTOINIT(vehic);
if(this.owner)
{
if(!forbidWeaponUse(this.owner))
- if(other != world)
+ if(other != NULL)
if((this.origin_z + this.maxs_z) > (other.origin_z))
if(vehicles_crushable(other))
{
Send_Notification(NOTIF_ONE, pl, MSG_CENTER, CENTER_VEHICLE_STEAL_SELF);
if (autocvar_g_vehicles_steal_show_waypoint) {
- entity wp = WaypointSprite_Spawn(WP_VehicleIntruder, 0, 0, pl, '0 0 68', world, veh.team, veh, wps_intruder, true, RADARICON_DANGER);
+ entity wp = WaypointSprite_Spawn(WP_VehicleIntruder, 0, 0, pl, '0 0 68', NULL, veh.team, veh, wps_intruder, true, RADARICON_DANGER);
wp.colormod = Team_ColorRGB(pl.team);
}
}
// disown & reset
this.vehicle_hudmodel.viewmodelforclient = this;
- this.owner = world;
+ this.owner = NULL;
settouch(this, vehicles_touch);
this.event_damage = vehicles_damage;
this.iscreature = true;
// Reset locking
this.lock_strength = 0;
- this.lock_target = world;
+ this.lock_target = NULL;
this.misc_bulletcounter = 0;
// Return to spawn
if(this.targetname && this.targetname != "")
{
- this.vehicle_controller = find(world, target, this.targetname);
+ this.vehicle_controller = find(NULL, target, this.targetname);
if(!this.vehicle_controller)
{
bprint("^1WARNING: ^7Vehicle with invalid .targetname\n");
if(autocvar_g_vehicle_bumblebee_cannon_lock)
{
if(gun.lock_time < time)
- gun.enemy = world;
+ gun.enemy = NULL;
if(trace_ent)
if(trace_ent.movetype)
fixedmakevectors(vehic.angles);
- if(player == vehic.gunner1) { vehic.gunner1 = world; }
- if(player == vehic.gunner2) { vehic.gunner2 = world; v_right *= -1; }
+ if(player == vehic.gunner1) { vehic.gunner1 = NULL; }
+ if(player == vehic.gunner2) { vehic.gunner2 = NULL; v_right *= -1; }
vector spot = real_origin(gunner);
spot = spot + v_up * 128 + v_forward * 300 + v_right * 150;
MUTATOR_CALLHOOK(VehicleExit, player, gunner);
- player.vehicle = world;
+ player.vehicle = NULL;
}
bool bumblebee_gunner_enter(entity this, entity player)
{
entity vehic = this;
- entity gunner = world;
+ entity gunner = NULL;
if(!vehic.gunner1 && !vehic.gunner2 && ((time >= vehic.gun1.phase) + (time >= vehic.gun2.phase)) == 2)
{
{
if(autocvar_g_vehicles_enter) { return; }
- if(this.gunner1 != world && this.gunner2 != world)
+ if(this.gunner1 != NULL && this.gunner2 != NULL)
{
vehicles_touch(this);
return;
if(autocvar_g_vehicle_bumblebee_healgun_locktime)
{
if(vehic.tur_head.lock_time < time || IS_DEAD(vehic.tur_head.enemy) || STAT(FROZEN, vehic.tur_head.enemy))
- vehic.tur_head.enemy = world;
+ vehic.tur_head.enemy = NULL;
if(trace_ent)
if(trace_ent.movetype)
if(vehic.gun3.enemy)
remove(vehic.gun3.enemy);
- vehic.gun3.enemy = world;
+ vehic.gun3.enemy = NULL;
}
*/
setorigin(this.owner, spot);
antilag_clear(this.owner, CS(this.owner));
- this.owner = world;
+ this.owner = NULL;
}
void bumblebee_blowup(entity this)
{
RadiusDamage(this, this.enemy, autocvar_g_vehicle_bumblebee_blowup_coredamage,
autocvar_g_vehicle_bumblebee_blowup_edgedamage,
- autocvar_g_vehicle_bumblebee_blowup_radius, this, world,
+ autocvar_g_vehicle_bumblebee_blowup_radius, this, NULL,
autocvar_g_vehicle_bumblebee_blowup_forceintensity,
- DEATH_VH_BUMB_DEATH.m_id, world);
+ DEATH_VH_BUMB_DEATH.m_id, NULL);
sound(this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
Send_Effect(EFFECT_EXPLOSION_BIG, (this.origin + '0 0 100') + (randomvec() * 80), '0 0 0', 1);
instance.scale = 1.5;
// Raygun beam
- if(instance.gun3.enemy == world)
+ if(instance.gun3.enemy == NULL)
{
instance.gun3.enemy = spawn();
Net_LinkEntity(instance.gun3.enemy, true, 0, bumble_raygun_send);
if(vehic.misc_bulletcounter == 1)
{
- racer_fire_rocket_aim(this, "tag_rocket_r", (vehic.lock_strength == 1 && vehic.lock_target) ? vehic.lock_target : world);
+ racer_fire_rocket_aim(this, "tag_rocket_r", (vehic.lock_strength == 1 && vehic.lock_target) ? vehic.lock_target : NULL);
this.vehicle_ammo2 = 50;
}
else if(vehic.misc_bulletcounter == 2)
{
- racer_fire_rocket_aim(this, "tag_rocket_l", (vehic.lock_strength == 1 && vehic.lock_target) ? vehic.lock_target : world);
+ racer_fire_rocket_aim(this, "tag_rocket_l", (vehic.lock_strength == 1 && vehic.lock_target) ? vehic.lock_target : NULL);
vehic.lock_strength = 0;
- vehic.lock_target = world;
+ vehic.lock_target = NULL;
vehic.misc_bulletcounter = 0;
vehic.delay = time + autocvar_g_vehicle_racer_rocket_refire;
vehic.lip = time;
setorigin(this.owner , spot);
}
antilag_clear(this.owner, CS(this.owner));
- this.owner = world;
+ this.owner = NULL;
}
void racer_blowup(entity this)
RadiusDamage (this, this.enemy, autocvar_g_vehicle_racer_blowup_coredamage,
autocvar_g_vehicle_racer_blowup_edgedamage,
- autocvar_g_vehicle_racer_blowup_radius, world, world,
+ autocvar_g_vehicle_racer_blowup_radius, NULL, NULL,
autocvar_g_vehicle_racer_blowup_forceintensity,
- DEATH_VH_WAKI_DEATH.m_id, world);
+ DEATH_VH_WAKI_DEATH.m_id, NULL);
this.nextthink = time + autocvar_g_vehicle_racer_respawntime;
setthink(this, vehicles_spawn);
void raptor_exit(entity this, int eject)
{
vector spot;
- this.tur_head.exteriormodeltoclient = world;
+ this.tur_head.exteriormodeltoclient = NULL;
if(!IS_DEAD(this))
{
}
antilag_clear(this.owner, CS(this.owner));
- this.owner = world;
+ this.owner = NULL;
}
bool raptor_frame(entity this)
if(autocvar_g_vehicle_raptor_cannon_locktarget == 2)
{
if(vehic.gun1.lock_time < time || IS_DEAD(vehic.gun1.enemy) || STAT(FROZEN, vehic.gun1.enemy))
- vehic.gun1.enemy = world;
+ vehic.gun1.enemy = NULL;
if(trace_ent)
if(trace_ent.movetype)
(1 / autocvar_g_vehicle_raptor_cannon_locking_releasetime) * frametime,
autocvar_g_vehicle_raptor_cannon_locked_time);
- if(vehic.lock_target != world)
+ if(vehic.lock_target != NULL)
if(autocvar_g_vehicle_raptor_cannon_predicttarget)
if(vehic.lock_strength == 1)
{
{
this.deadflag = DEAD_DEAD;
this.vehicle_exit(this, VHEF_NORMAL);
- RadiusDamage (this, this.enemy, 250, 15, 250, world, world, 250, DEATH_VH_RAPT_DEATH.m_id, world);
+ RadiusDamage (this, this.enemy, 250, 15, 250, NULL, NULL, 250, DEATH_VH_RAPT_DEATH.m_id, NULL);
this.alpha = -1;
this.movetype = MOVETYPE_NONE;
{
RadiusDamage (this, this.realowner, autocvar_g_vehicle_raptor_bomblet_damage,
autocvar_g_vehicle_raptor_bomblet_edgedamage,
- autocvar_g_vehicle_raptor_bomblet_radius, world, world,
- autocvar_g_vehicle_raptor_bomblet_force, DEATH_VH_RAPT_BOMB.m_id, world);
+ autocvar_g_vehicle_raptor_bomblet_radius, NULL, NULL,
+ autocvar_g_vehicle_raptor_bomblet_force, DEATH_VH_RAPT_BOMB.m_id, NULL);
remove(this);
}
if(e.owner == this.owner)
{
e.realowner = this.owner;
- e.owner = world;
+ e.owner = NULL;
}
e = e.chain;
}
}
antilag_clear(this.owner, CS(this.owner));
- this.owner = world;
+ this.owner = NULL;
}
void spiderbot_headfade(entity this)
SUB_SetFade(g1, time, min(this.respawntime, 10));
SUB_SetFade(g2, time, min(this.respawntime, 10));
- RadiusDamage (this, this.enemy, 250, 15, 250, world, world, 250, DEATH_VH_SPID_DEATH.m_id, world);
+ RadiusDamage (this, this.enemy, 250, 15, 250, NULL, NULL, 250, DEATH_VH_SPID_DEATH.m_id, NULL);
this.alpha = this.tur_head.alpha = this.gun1.alpha = this.gun2.alpha = -1;
this.movetype = MOVETYPE_NONE;
void spiderbot_rocket_do(entity this)
{;
vector v;
- entity rocket = world;
+ entity rocket = NULL;
if (this.wait != -10)
{
void viewloc_SetTags(entity this)
{
if(this.viewloc && wasfreed(this.viewloc))
- this.viewloc = world;
+ this.viewloc = NULL;
if(this.viewloc.entnum != this.tag_networkviewloc)
if(this.tag_networkviewloc == 0)
- this.viewloc = world;
+ this.viewloc = NULL;
else
- this.viewloc = findfloat(world, entnum, this.tag_networkviewloc);
+ this.viewloc = findfloat(NULL, entnum, this.tag_networkviewloc);
}
vector old_camera_angle = '0 0 0';
for (i = WEP_FIRST; i <= WEP_LAST; ++i)
W_FixWeaponOrder_BuildImpulseList_buf[i - WEP_FIRST] = i;
heapsort(WEP_LAST - WEP_FIRST + 1, W_FixWeaponOrder_BuildImpulseList_swap, W_FixWeaponOrder_BuildImpulseList_cmp,
- world);
+ NULL);
o = "";
for (i = WEP_FIRST; i <= WEP_LAST; ++i)
o = strcat(o, " ", ftos(W_FixWeaponOrder_BuildImpulseList_buf[i - WEP_FIRST]));
it.wr_config(it);
// step 3: sort queue
- heapsort(WEP_CONFIG_COUNT, W_Config_Queue_Swap, W_Config_Queue_Compare, world);
+ heapsort(WEP_CONFIG_COUNT, W_Config_Queue_Swap, W_Config_Queue_Compare, NULL);
// step 4: write queue
WEP_CONFIG_WRITETOFILE(sprintf(
void W_Arc_Bolt_Explode(entity this)
{
this.event_damage = func_null;
- RadiusDamage(this, this.realowner, WEP_CVAR(arc, bolt_damage), WEP_CVAR(arc, bolt_edgedamage), WEP_CVAR(arc, bolt_radius), world, world, WEP_CVAR(arc, bolt_force), this.projectiledeathtype, other);
+ RadiusDamage(this, this.realowner, WEP_CVAR(arc, bolt_damage), WEP_CVAR(arc, bolt_edgedamage), WEP_CVAR(arc, bolt_radius), NULL, NULL, WEP_CVAR(arc, bolt_force), this.projectiledeathtype, other);
remove(this);
}
}
}
- if(this == this.owner.arc_beam) { this.owner.arc_beam = world; }
+ if(this == this.owner.arc_beam) { this.owner.arc_beam = NULL; }
entity own = this.owner;
Weapon w = WEP_ARC;
if(!w.wr_checkammo1(w, own) && !w.wr_checkammo2(w, own))
void Reset_ArcBeam()
{
entity e;
- for (e = world; (e = findfloat(e, beam_usevieworigin, 1)); ) {
+ for (e = NULL; (e = findfloat(e, beam_usevieworigin, 1)); ) {
e.beam_initialized = false;
}
- for (e = world; (e = findfloat(e, beam_usevieworigin, 2)); ) {
+ for (e = NULL; (e = findfloat(e, beam_usevieworigin, 2)); ) {
e.beam_initialized = false;
}
}
'0 0 0',
new_origin,
MOVE_NORMAL,
- world,
- world,
+ NULL,
+ NULL,
Draw_ArcBeam_callback
);
}
// cleanup
- Draw_ArcBeam_callback_entity = world;
+ Draw_ArcBeam_callback_entity = NULL;
Draw_ArcBeam_callback_last_thickness = 0;
Draw_ArcBeam_callback_last_top = '0 0 0';
Draw_ArcBeam_callback_last_bottom = '0 0 0';
if(isnew)
{
- int gunalign = W_GetGunAlignment(world);
+ int gunalign = W_GetGunAlignment(NULL);
this.beam_shotorigin = arc_shotorigin[gunalign];
this.blaster_damage,
this.blaster_edgedamage,
this.blaster_radius,
- world,
- world,
+ NULL,
+ NULL,
this.blaster_force,
this.projectiledeathtype,
other
float i;
entity p;
- if(e == world)
- error("W_Crylink_CheckLinks: entity is world");
+ if(e == NULL)
+ error("W_Crylink_CheckLinks: entity is NULL");
if(e.classname != "spike" || wasfreed(e))
error(sprintf("W_Crylink_CheckLinks: entity is not a spike but a %s (freed: %d)", e.classname, wasfreed(e)));
{
W_Crylink_CheckLinks(next);
if(me == own.crylink_lastgroup)
- own.crylink_lastgroup = ((me == next) ? world : next);
+ own.crylink_lastgroup = ((me == next) ? NULL : next);
prev.queuenext = next;
next.queueprev = prev;
me.classname = "spike_oktoremove";
a = bound(0, 1 - (time - e.fade_time) * e.fade_rate, 1);
if(e == e.realowner.crylink_lastgroup)
- e.realowner.crylink_lastgroup = world;
+ e.realowner.crylink_lastgroup = NULL;
float isprimary = !(e.projectiledeathtype & HITTYPE_SECONDARY);
- RadiusDamage(e, e.realowner, WEP_CVAR_BOTH(crylink, isprimary, damage) * a, WEP_CVAR_BOTH(crylink, isprimary, edgedamage) * a, WEP_CVAR_BOTH(crylink, isprimary, radius), world, world, WEP_CVAR_BOTH(crylink, isprimary, force) * a, e.projectiledeathtype, other);
+ RadiusDamage(e, e.realowner, WEP_CVAR_BOTH(crylink, isprimary, damage) * a, WEP_CVAR_BOTH(crylink, isprimary, edgedamage) * a, WEP_CVAR_BOTH(crylink, isprimary, radius), NULL, NULL, WEP_CVAR_BOTH(crylink, isprimary, force) * a, e.projectiledeathtype, other);
W_Crylink_LinkExplode(e.queuenext, e2);
WEP_CVAR_BOTH(crylink, isprimary, joinexplode_edgedamage) * n,
WEP_CVAR_BOTH(crylink, isprimary, joinexplode_radius) * n,
e.realowner,
- world,
+ NULL,
WEP_CVAR_BOTH(crylink, isprimary, joinexplode_force) * n,
e.projectiledeathtype,
other
if(a)
f *= a;
- float totaldamage = RadiusDamage(this, this.realowner, WEP_CVAR_BOTH(crylink, isprimary, damage) * f, WEP_CVAR_BOTH(crylink, isprimary, edgedamage) * f, WEP_CVAR_BOTH(crylink, isprimary, radius), world, world, WEP_CVAR_BOTH(crylink, isprimary, force) * f, this.projectiledeathtype, other);
+ float totaldamage = RadiusDamage(this, this.realowner, WEP_CVAR_BOTH(crylink, isprimary, damage) * f, WEP_CVAR_BOTH(crylink, isprimary, edgedamage) * f, WEP_CVAR_BOTH(crylink, isprimary, radius), NULL, NULL, WEP_CVAR_BOTH(crylink, isprimary, force) * f, this.projectiledeathtype, other);
if(totaldamage && ((WEP_CVAR_BOTH(crylink, isprimary, linkexplode) == 2) || ((WEP_CVAR_BOTH(crylink, isprimary, linkexplode) == 1) && !W_Crylink_Touch_WouldHitFriendly(this, WEP_CVAR_BOTH(crylink, isprimary, radius)))))
{
if(this == this.realowner.crylink_lastgroup)
- this.realowner.crylink_lastgroup = world;
+ this.realowner.crylink_lastgroup = NULL;
W_Crylink_LinkExplode(this.queuenext, this);
this.classname = "spike_oktoremove";
remove(this);
}
this.cnt = this.cnt - 1;
this.angles = vectoangles(this.velocity);
- this.owner = world;
+ this.owner = NULL;
this.projectiledeathtype |= HITTYPE_BOUNCE;
// commented out as it causes a little hitch...
//if(proj.cnt == 0)
shots = WEP_CVAR_PRI(crylink, shots);
Send_Effect(EFFECT_CRYLINK_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, shots);
- proj = prevproj = firstproj = world;
+ proj = prevproj = firstproj = NULL;
for(counter = 0; counter < shots; ++counter)
{
proj = new(spike);
shots = WEP_CVAR_SEC(crylink, shots);
Send_Effect(EFFECT_CRYLINK_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, shots);
- proj = prevproj = firstproj = world;
+ proj = prevproj = firstproj = NULL;
for(counter = 0; counter < shots; ++counter)
{
proj = new(spike);
{
if(this.realowner && this.realowner.lastrocket == this)
{
- this.realowner.lastrocket = world;
+ this.realowner.lastrocket = NULL;
// this.realowner.rl_release = 1;
}
}
WEP_CVAR(devastator, damage),
WEP_CVAR(devastator, edgedamage),
WEP_CVAR(devastator, radius),
- world,
- world,
+ NULL,
+ NULL,
WEP_CVAR(devastator, force),
this.projectiledeathtype,
other
WEP_CVAR(devastator, remote_jump_damage),
WEP_CVAR(devastator, remote_jump_damage),
WEP_CVAR(devastator, remote_jump_radius),
- world,
+ NULL,
head,
0,
this.projectiledeathtype | HITTYPE_BOUNCE,
- world
+ NULL
);
break;
}
WEP_CVAR(devastator, remote_damage),
WEP_CVAR(devastator, remote_edgedamage),
WEP_CVAR(devastator, remote_radius),
- (handled_as_rocketjump ? head : world),
- world,
+ (handled_as_rocketjump ? head : NULL),
+ NULL,
WEP_CVAR(devastator, remote_force),
this.projectiledeathtype | HITTYPE_BOUNCE,
- world
+ NULL
);
Weapon thiswep = WEP_DEVASTATOR;
this.nextthink = time;
if(time > this.cnt)
{
- other = world;
+ other = NULL;
this.projectiledeathtype |= HITTYPE_BOUNCE;
W_Devastator_Explode(this);
return;
// decide whether to detonate rockets
entity missile, targetlist, targ;
targetlist = findchainfloat(bot_attack, true);
- for(missile = world; (missile = find(missile, classname, "rocket")); ) if(missile.realowner == actor)
+ for(missile = NULL; (missile = find(missile, classname, "rocket")); ) if(missile.realowner == actor)
{
targ = targetlist;
while(targ)
{
entity rock;
bool rockfound = false;
- for(rock = world; (rock = find(rock, classname, "rocket")); ) if(rock.realowner == actor)
+ for(rock = NULL; (rock = find(rock, classname, "rocket")); ) if(rock.realowner == actor)
{
if(!rock.rl_detonate_later)
{
WEP_CVAR(electro, combo_damage),
WEP_CVAR(electro, combo_edgedamage),
WEP_CVAR(electro, combo_radius),
- world,
- world,
+ NULL,
+ NULL,
WEP_CVAR(electro, combo_force),
WEP_ELECTRO.m_id | HITTYPE_BOUNCE, // use THIS type for a combo because primary can't bounce
- world
+ NULL
);
remove(this);
WEP_CVAR_SEC(electro, damage),
WEP_CVAR_SEC(electro, edgedamage),
WEP_CVAR_SEC(electro, radius),
- world,
- world,
+ NULL,
+ NULL,
WEP_CVAR_SEC(electro, force),
this.projectiledeathtype,
other
WEP_CVAR_PRI(electro, damage),
WEP_CVAR_PRI(electro, edgedamage),
WEP_CVAR_PRI(electro, radius),
- world,
- world,
+ NULL,
+ NULL,
WEP_CVAR_PRI(electro, force),
this.projectiledeathtype,
other
// 1. dist damage
d = (this.realowner.health + this.realowner.armorvalue);
- RadiusDamage(this, this.realowner, WEP_CVAR_PRI(fireball, damage), WEP_CVAR_PRI(fireball, edgedamage), WEP_CVAR_PRI(fireball, radius), world, world, WEP_CVAR_PRI(fireball, force), this.projectiledeathtype, other);
+ RadiusDamage(this, this.realowner, WEP_CVAR_PRI(fireball, damage), WEP_CVAR_PRI(fireball, edgedamage), WEP_CVAR_PRI(fireball, radius), NULL, NULL, WEP_CVAR_PRI(fireball, force), this.projectiledeathtype, other);
if(this.realowner.health + this.realowner.armorvalue >= d)
if(!this.cnt)
{
{
this.cnt += 1;
if(this.cnt == 3)
- this.owner = world;
+ this.owner = NULL;
}
else
this.cnt = 0;
void W_Hagar_Explode(entity this)
{
this.event_damage = func_null;
- RadiusDamage(this, this.realowner, WEP_CVAR_PRI(hagar, damage), WEP_CVAR_PRI(hagar, edgedamage), WEP_CVAR_PRI(hagar, radius), world, world, WEP_CVAR_PRI(hagar, force), this.projectiledeathtype, other);
+ RadiusDamage(this, this.realowner, WEP_CVAR_PRI(hagar, damage), WEP_CVAR_PRI(hagar, edgedamage), WEP_CVAR_PRI(hagar, radius), NULL, NULL, WEP_CVAR_PRI(hagar, force), this.projectiledeathtype, other);
remove(this);
}
void W_Hagar_Explode2(entity this)
{
this.event_damage = func_null;
- RadiusDamage(this, this.realowner, WEP_CVAR_SEC(hagar, damage), WEP_CVAR_SEC(hagar, edgedamage), WEP_CVAR_SEC(hagar, radius), world, world, WEP_CVAR_SEC(hagar, force), this.projectiledeathtype, other);
+ RadiusDamage(this, this.realowner, WEP_CVAR_SEC(hagar, damage), WEP_CVAR_SEC(hagar, edgedamage), WEP_CVAR_SEC(hagar, radius), NULL, NULL, WEP_CVAR_SEC(hagar, force), this.projectiledeathtype, other);
remove(this);
}
if(this.health <= 0)
return;
- float is_linkexplode = ( ((inflictor.owner != world) ? (inflictor.owner == this.owner) : true)
+ float is_linkexplode = ( ((inflictor.owner != NULL) ? (inflictor.owner == this.owner) : true)
&& (inflictor.projectiledeathtype & HITTYPE_SECONDARY)
&& (this.projectiledeathtype & HITTYPE_SECONDARY));
this.cnt++;
Send_Effect(EFFECT_HAGAR_BOUNCE, this.origin, this.velocity, 1);
this.angles = vectoangles(this.velocity);
- this.owner = world;
+ this.owner = NULL;
this.projectiledeathtype |= HITTYPE_BOUNCE;
}
}
up = v_up;
shots = actor.hagar_load;
- missile = world;
+ missile = NULL;
for(counter = 0; counter < shots; ++counter)
{
missile = new(missile);
isprimary = !(this.projectiledeathtype & HITTYPE_SECONDARY);
- RadiusDamage(this, this.realowner, WEP_CVAR_BOTH(hlac, isprimary, damage), WEP_CVAR_BOTH(hlac, isprimary, edgedamage), WEP_CVAR_BOTH(hlac, isprimary, radius), world, world, WEP_CVAR_BOTH(hlac, isprimary, force), this.projectiledeathtype, other);
+ RadiusDamage(this, this.realowner, WEP_CVAR_BOTH(hlac, isprimary, damage), WEP_CVAR_BOTH(hlac, isprimary, edgedamage), WEP_CVAR_BOTH(hlac, isprimary, radius), NULL, NULL, WEP_CVAR_BOTH(hlac, isprimary, force), this.projectiledeathtype, other);
remove(this);
}
f = this.dmg_last - dmg_remaining_next;
this.dmg_last = dmg_remaining_next;
- RadiusDamage(this, this.realowner, this.dmg * f, this.dmg_edge * f, this.dmg_radius, this.realowner, world, this.dmg_force * f, this.projectiledeathtype, world);
+ RadiusDamage(this, this.realowner, this.dmg * f, this.dmg_edge * f, this.dmg_radius, this.realowner, NULL, this.dmg_force * f, this.projectiledeathtype, NULL);
this.projectiledeathtype |= HITTYPE_BOUNCE;
- //RadiusDamage(this, world, this.dmg * f, this.dmg_edge * f, this.dmg_radius, world, world, this.dmg_force * f, this.projectiledeathtype, world);
+ //RadiusDamage(this, NULL, this.dmg * f, this.dmg_edge * f, this.dmg_radius, NULL, NULL, this.dmg_force * f, this.projectiledeathtype, NULL);
if(dt < this.dmg_duration)
this.nextthink = time + 0.05; // soon
InterpolateOrigin_Do(this);
- int s = W_GetGunAlignment(world);
+ int s = W_GetGunAlignment(NULL);
switch(this.HookType)
{
b = view_origin + view_forward * this.HookRange;
else
b = view_origin + view_forward * vlen(this.velocity - this.origin); // honor original length of beam!
- WarpZone_TraceLine(view_origin, b, MOVE_NORMAL, world);
+ WarpZone_TraceLine(view_origin, b, MOVE_NORMAL, NULL);
b = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
a = view_origin + view_forward * vs.x + view_right * -vs.y + view_up * vs.z;
break;
Draw_GrapplingHook_trace_callback_rnd = offset;
Draw_GrapplingHook_trace_callback_rgb = rgb;
Draw_GrapplingHook_trace_callback_a = intensity;
- WarpZone_TraceBox_ThroughZone(a, '0 0 0', '0 0 0', b, ((this.HookType == NET_ENT_CLIENT_HOOK) ? MOVE_NOTHING : MOVE_NORMAL), world, world, Draw_GrapplingHook_trace_callback);
+ WarpZone_TraceBox_ThroughZone(a, '0 0 0', '0 0 0', b, ((this.HookType == NET_ENT_CLIENT_HOOK) ? MOVE_NOTHING : MOVE_NORMAL), NULL, NULL, Draw_GrapplingHook_trace_callback);
Draw_GrapplingHook_trace_callback_tex = string_null;
atrans = WarpZone_TransformOrigin(WarpZone_trace_transform, a);
{
setthink(this, SUB_Remove);
this.nextthink = time;
- this.realowner.muzzle_flash = world;
+ this.realowner.muzzle_flash = NULL;
return;
}
void W_MachineGun_MuzzleFlash(entity actor)
{
- if(actor.muzzle_flash == world)
+ if(actor.muzzle_flash == NULL)
actor.muzzle_flash = spawn();
// muzzle flash for 1st person view
this.event_damage = func_null;
this.takedamage = DAMAGE_NO;
- RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, damage), WEP_CVAR(minelayer, edgedamage), WEP_CVAR(minelayer, radius), world, world, WEP_CVAR(minelayer, force), this.projectiledeathtype, other);
+ RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, damage), WEP_CVAR(minelayer, edgedamage), WEP_CVAR(minelayer, radius), NULL, NULL, WEP_CVAR(minelayer, force), this.projectiledeathtype, other);
if(PS(this.realowner).m_weapon == WEP_MINE_LAYER)
{
if(this.movetype == MOVETYPE_NONE || this.movetype == MOVETYPE_FOLLOW)
this.velocity = this.mine_orientation; // particle fx and decals need .velocity
- RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, remote_damage), WEP_CVAR(minelayer, remote_edgedamage), WEP_CVAR(minelayer, remote_radius), world, world, WEP_CVAR(minelayer, remote_force), this.projectiledeathtype | HITTYPE_BOUNCE, world);
+ RadiusDamage(this, this.realowner, WEP_CVAR(minelayer, remote_damage), WEP_CVAR(minelayer, remote_edgedamage), WEP_CVAR(minelayer, remote_radius), NULL, NULL, WEP_CVAR(minelayer, remote_force), this.projectiledeathtype | HITTYPE_BOUNCE, NULL);
if(PS(this.realowner).m_weapon == WEP_MINE_LAYER)
{
{
int minecount = 0;
entity mine;
- for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.realowner == e)
+ for(mine = NULL; (mine = find(mine, classname, "mine")); ) if(mine.realowner == e)
minecount += 1;
return minecount;
// TODO: Do this on team change too -- Samual: But isn't a player killed when they switch teams?
if(!IS_PLAYER(this.realowner) || IS_DEAD(this.realowner) || STAT(FROZEN, this.realowner))
{
- other = world;
+ other = NULL;
this.projectiledeathtype |= HITTYPE_BOUNCE;
W_MineLayer_Explode(this);
return;
entity mine;
float minfound = 0;
- for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.realowner == this)
+ for(mine = NULL; (mine = find(mine, classname, "mine")); ) if(mine.realowner == this)
{
if(detonate)
{
teamdamage = 0;
enemydamage = 0;
targetlist = findchainfloat(bot_attack, true);
- entity mine = find(world, classname, "mine");
+ entity mine = find(NULL, classname, "mine");
while(mine)
{
if(mine.realowner != actor)
if(teamplay && actor.team)
desirabledamage = desirabledamage - teamdamage;
- mine = find(world, classname, "mine");
+ mine = find(NULL, classname, "mine");
while(mine)
{
if(mine.realowner != actor)
if(this.movetype == MOVETYPE_NONE)
this.velocity = this.oldvelocity;
- RadiusDamage(this, this.realowner, WEP_CVAR_PRI(mortar, damage), WEP_CVAR_PRI(mortar, edgedamage), WEP_CVAR_PRI(mortar, radius), world, world, WEP_CVAR_PRI(mortar, force), this.projectiledeathtype, other);
+ RadiusDamage(this, this.realowner, WEP_CVAR_PRI(mortar, damage), WEP_CVAR_PRI(mortar, edgedamage), WEP_CVAR_PRI(mortar, radius), NULL, NULL, WEP_CVAR_PRI(mortar, force), this.projectiledeathtype, other);
remove(this);
}
if(this.movetype == MOVETYPE_NONE)
this.velocity = this.oldvelocity;
- RadiusDamage(this, this.realowner, WEP_CVAR_SEC(mortar, damage), WEP_CVAR_SEC(mortar, edgedamage), WEP_CVAR_SEC(mortar, radius), world, world, WEP_CVAR_SEC(mortar, force), this.projectiledeathtype, other);
+ RadiusDamage(this, this.realowner, WEP_CVAR_SEC(mortar, damage), WEP_CVAR_SEC(mortar, edgedamage), WEP_CVAR_SEC(mortar, radius), NULL, NULL, WEP_CVAR_SEC(mortar, force), this.projectiledeathtype, other);
remove(this);
}
this.nextthink = time;
if(time > this.cnt)
{
- other = world;
+ other = NULL;
this.projectiledeathtype |= HITTYPE_BOUNCE;
W_Mortar_Grenade_Explode(this);
return;
{
bool nadefound = false;
entity nade;
- for(nade = world; (nade = find(nade, classname, "grenade")); ) if(nade.realowner == actor)
+ for(nade = NULL; (nade = find(nade, classname, "grenade")); ) if(nade.realowner == actor)
{
if(!nade.gl_detonate_later)
{
void W_Porto_Success(entity this)
{
- if(this.realowner == world)
+ if(this.realowner == NULL)
{
objerror(this, "Cannot succeed successfully: no owner\n");
return;
}
- this.realowner.porto_current = world;
+ this.realowner.porto_current = NULL;
remove(this);
}
string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vector velo);
void W_Porto_Fail(entity this, float failhard)
{
- if(this.realowner == world)
+ if(this.realowner == NULL)
{
objerror(this, "Cannot fail successfully: no owner\n");
return;
Portal_ClearWithID(this.realowner, this.portal_id);
}
- this.realowner.porto_current = world;
+ this.realowner.porto_current = NULL;
if(this.cnt < 0 && !failhard && this.realowner.playerid == this.playerid && !IS_DEAD(this.realowner) && !(this.realowner.weapons & WEPSET(PORTO)))
{
}
METHOD(PortoLaunch, wr_resetplayer, void(entity thiswep, entity actor))
{
- actor.porto_current = world;
+ actor.porto_current = NULL;
}
#endif
#ifdef CSQC
void W_Seeker_Missile_Explode(entity this)
{
this.event_damage = func_null;
- RadiusDamage(this, this.realowner, WEP_CVAR(seeker, missile_damage), WEP_CVAR(seeker, missile_edgedamage), WEP_CVAR(seeker, missile_radius), world, world, WEP_CVAR(seeker, missile_force), this.projectiledeathtype, other);
+ RadiusDamage(this, this.realowner, WEP_CVAR(seeker, missile_damage), WEP_CVAR(seeker, missile_edgedamage), WEP_CVAR(seeker, missile_radius), NULL, NULL, WEP_CVAR(seeker, missile_force), this.projectiledeathtype, other);
remove(this);
}
spd + WEP_CVAR(seeker, missile_accel) * frametime
);
- if(this.enemy != world)
+ if(this.enemy != NULL)
if(this.enemy.takedamage != DAMAGE_AIM || IS_DEAD(this.enemy))
- this.enemy = world;
+ this.enemy = NULL;
- if(this.enemy != world)
+ if(this.enemy != NULL)
{
e = this.enemy;
eorg = 0.5 * (e.absmin + e.absmax);
if(IS_DEAD(this.enemy))
{
- this.enemy = world;
+ this.enemy = NULL;
this.cnt = time + 1 + (random() * 4);
this.nextthink = this.cnt;
return;
this.frame = this.frame +1;
this.nextthink = time + 0.05;
- if(this.enemy != world)
+ if(this.enemy != NULL)
if(this.enemy.takedamage != DAMAGE_AIM || IS_DEAD(this.enemy))
- this.enemy = world;
+ this.enemy = NULL;
if(this.frame == 5)
{
missile.damagedbycontents = true;
//missile.think = W_Seeker_Missile_Animate; // csqc projectiles.
- if(missile.enemy != world)
+ if(missile.enemy != NULL)
missile.projectiledeathtype = WEP_SEEKER.m_id | HITTYPE_SECONDARY;
else
missile.projectiledeathtype = WEP_SEEKER.m_id;
{
this.event_damage = func_null;
- RadiusDamage(this, this.realowner, WEP_CVAR(seeker, flac_damage), WEP_CVAR(seeker, flac_edgedamage), WEP_CVAR(seeker, flac_radius), world, world, WEP_CVAR(seeker, flac_force), this.projectiledeathtype, other);
+ RadiusDamage(this, this.realowner, WEP_CVAR(seeker, flac_damage), WEP_CVAR(seeker, flac_edgedamage), WEP_CVAR(seeker, flac_radius), NULL, NULL, WEP_CVAR(seeker, flac_force), this.projectiledeathtype, other);
remove(this);
}
entity W_Seeker_Tagged_Info(entity isowner, entity istarget)
{
entity tag;
- for(tag = world; (tag = find(tag, classname, "tag_tracker")); )
+ for(tag = NULL; (tag = find(tag, classname, "tag_tracker")); )
if((tag.realowner == isowner) && (tag.tag_target == istarget))
return tag;
- return world;
+ return NULL;
}
void W_Seeker_Attack(entity actor)
{
entity tracker, closest_target;
- closest_target = world;
- for(tracker = world; (tracker = find(tracker, classname, "tag_tracker")); ) if (tracker.realowner == actor)
+ closest_target = NULL;
+ for(tracker = NULL; (tracker = find(tracker, classname, "tag_tracker")); ) if (tracker.realowner == actor)
{
if(closest_target)
{
traceline(actor.origin + actor.view_ofs, closest_target.origin, MOVE_NOMONSTERS, actor);
if((!closest_target) || ((trace_fraction < 1) && (trace_ent != closest_target)))
- closest_target = world;
+ closest_target = NULL;
W_Seeker_Fire_Missile(WEP_SEEKER, actor, '0 0 0', closest_target);
}
// check to see if this person is already tagged by me
entity tag = W_Seeker_Tagged_Info(this.realowner, other);
- if(tag != world)
+ if(tag != NULL)
{
if(other.wps_tag_tracker && (WEP_CVAR(seeker, type) == 1)) // don't attach another waypointsprite without killing the old one first
WaypointSprite_Kill(other.wps_tag_tracker);
METHOD(Seeker, wr_aim, void(entity thiswep, entity actor))
{
if(WEP_CVAR(seeker, type) == 1)
- if(W_Seeker_Tagged_Info(actor, actor.enemy) != world)
+ if(W_Seeker_Tagged_Info(actor, actor.enemy) != NULL)
PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), false);
else
PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
// draw lightning beams for debugging
#ifdef DEBUG_SHOCKWAVE
- te_lightning2(world, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5);
+ te_lightning2(NULL, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5);
te_customflash(targpos, 40, 2, '1 1 1');
#endif
// figure out the direction of force
final_force = (w_shotdir * WEP_CVAR(shockwave, blast_splash_force_forwardbias));
final_force = normalize(CENTER_OR_VIEWOFS(head) - (attack_hitpos - final_force));
- //te_lightning2(world, attack_hitpos, (attack_hitpos + (final_force * 200)));
+ //te_lightning2(NULL, attack_hitpos, (attack_hitpos + (final_force * 200)));
// now multiply the direction by force units
final_force *= (WEP_CVAR(shockwave, blast_splash_force) * multiplier);
// figure out the direction of force
final_force = (w_shotdir * WEP_CVAR(shockwave, blast_force_forwardbias));
final_force = normalize(center - (nearest_on_line - final_force));
- //te_lightning2(world, nearest_on_line, (attack_hitpos + (final_force * 200)));
+ //te_lightning2(NULL, nearest_on_line, (attack_hitpos + (final_force * 200)));
// now multiply the direction by force units
final_force *= (WEP_CVAR(shockwave, blast_force) * multiplier);
));
#endif
- shockwave_hit[i-1] = world;
+ shockwave_hit[i-1] = NULL;
shockwave_hit_force[i-1] = '0 0 0';
shockwave_hit_damage[i-1] = 0;
}
deviation = ((this.sw_shotdir + (right * deviation.y) + (up * deviation.z)));
new_min_dist = SW_DISTTOMIN;
new_min_end = (this.sw_shotorg + (deviation * new_min_dist));
- //te_lightning2(world, new_min_end, this.sw_shotorg);
+ //te_lightning2(NULL, new_min_end, this.sw_shotorg);
// then calculate spread_to_max effect
deviation = angle * spread_to_max;
deviation = ((this.sw_shotdir + (right * deviation.y) + (up * deviation.z)));
new_max_dist = vlen(new_min_end - endpos);
new_max_end = (new_min_end + (deviation * new_max_dist));
- //te_lightning2(world, new_end, prev_min_end);
+ //te_lightning2(NULL, new_end, prev_min_end);
if(counter == 0)
WarpZone_traceline_antilag(this, this.realowner.origin + this.realowner.view_ofs, targpos, false, this.realowner, ANTILAG_LATENCY(this.realowner));
// draw lightning beams for debugging
- //te_lightning2(world, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5);
+ //te_lightning2(NULL, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5);
//te_customflash(targpos, 40, 2, '1 1 1');
is_player = (IS_PLAYER(trace_ent) || trace_ent.classname == "body" || IS_MONSTER(trace_ent));
Draw_VaporizerBeam_trace_callback_rnd = 0;
Draw_VaporizerBeam_trace_callback_rgb = rgb;
Draw_VaporizerBeam_trace_callback_a = bound(0, fail, 1);
- WarpZone_TraceBox_ThroughZone(this.vorg1, '0 0 0', '0 0 0', this.vorg2, MOVE_NOTHING, world, world, Draw_VaporizerBeam_trace_callback);
+ WarpZone_TraceBox_ThroughZone(this.vorg1, '0 0 0', '0 0 0', this.vorg2, MOVE_NOTHING, NULL, NULL, Draw_VaporizerBeam_trace_callback);
Draw_VaporizerBeam_trace_callback_tex = string_null;
/*if(!MUTATOR_CALLHOOK(Particles_VaporizerBeam, this.vorg1, this.vorg2))
if(autocvar_cl_particles_oldvortexbeam && (STAT(ALLOW_OLDVORTEXBEAM) || isdemo()))
- WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), this.vorg1, this.vorg2, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
+ WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), this.vorg1, this.vorg2, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
else
- WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM), this.vorg1, this.vorg2, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);*/
+ WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM), this.vorg1, this.vorg2, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);*/
}
NET_HANDLE(TE_CSQC_VAPORBEAMPARTICLE, bool isNew)
if(autocvar_cl_vaporizerbeam_particle)
{
- WarpZone_TrailParticles(world, particleeffectnum(((this.cnt) ? EFFECT_VAPORIZER_HIT(this.team) : EFFECT_VAPORIZER(this.team))), this.vorg1, this.vorg2);
+ WarpZone_TrailParticles(NULL, particleeffectnum(((this.cnt) ? EFFECT_VAPORIZER_HIT(this.team) : EFFECT_VAPORIZER(this.team))), this.vorg1, this.vorg2);
this.draw = func_null;
this.drawmask = MASK_NORMAL;
remove(this);
entity dmgent = spawn();
dmgent.owner = dmgent.realowner = actor;
setorigin(dmgent, loc);
- RadiusDamage (dmgent, actor, autocvar_g_rm_damage, autocvar_g_rm_edgedamage, autocvar_g_rm_radius, world, world, autocvar_g_rm_force, WEP_DEVASTATOR.m_id | HITTYPE_SPLASH, other);
+ RadiusDamage (dmgent, actor, autocvar_g_rm_damage, autocvar_g_rm_edgedamage, autocvar_g_rm_radius, NULL, NULL, autocvar_g_rm_force, WEP_DEVASTATOR.m_id | HITTYPE_SPLASH, other);
remove(dmgent);
}
this.event_damage = func_null;
this.takedamage = DAMAGE_NO;
- RadiusDamage (this, this.realowner, this.rm_damage, this.rm_edmg, autocvar_g_rm_laser_radius, world, world, this.rm_force, this.projectiledeathtype, other);
+ RadiusDamage (this, this.realowner, this.rm_damage, this.rm_edmg, autocvar_g_rm_laser_radius, NULL, NULL, this.rm_force, this.projectiledeathtype, other);
remove(this);
}
{
PROJECTILE_TOUCH(this);
//W_RocketMinsta_Laser_Explode ();
- RadiusDamage (this, this.realowner, this.rm_damage, this.rm_edmg, autocvar_g_rm_laser_radius, world, world, this.rm_force, this.projectiledeathtype, other);
+ RadiusDamage (this, this.realowner, this.rm_damage, this.rm_edmg, autocvar_g_rm_laser_radius, NULL, NULL, this.rm_force, this.projectiledeathtype, other);
remove(this);
}
if(!MUTATOR_CALLHOOK(Particles_VortexBeam, shotorg, endpos))
if(autocvar_cl_particles_oldvortexbeam && (STAT(ALLOW_OLDVORTEXBEAM) || isdemo()))
- WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
+ WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
else
- WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
+ WarpZone_TrailParticles_WithMultiplier(NULL, particleeffectnum(EFFECT_VORTEX_BEAM), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
return true;
}
#endif
entity sort;
sort = spawn();
sort.sort_cmp = cmp;
- sort.sort_next = world;
+ sort.sort_next = NULL;
sort.chain = sort;
return sort;
}
float Sort_HasNext(entity sort)
{
- return (sort.chain.sort_next != world);
+ return (sort.chain.sort_next != NULL);
}
entity Sort_Next(entity sort)
next = spawn();
sort.chain.sort_next = next;
next.sort_prev = sort.chain;
- next.sort_next = world;
+ next.sort_next = NULL;
}
sort.chain = next;
return next;
#define REGISTER_STAT_3(id, T, expr) \
REGISTER_STAT_2(id, T); \
[[accumulate]] void GlobalStats_update(entity this) { STAT(id, this) = (expr); } \
- STATIC_INIT(worldstat_##id) { entity this = world; STAT(id, this) = (expr); }
+ STATIC_INIT(worldstat_##id) { entity this = NULL; STAT(id, this) = (expr); }
#else
#define REGISTER_STAT_2(id, type)
#define REGISTER_STAT_3(id, T, expr)
vr = WarpZone_TransformVelocity(this, vr);
vu = WarpZone_TransformVelocity(this, vu);
if(autocvar_cl_warpzone_usetrace)
- traceline(this.warpzone_targetorigin, org, MOVE_NOMONSTERS, world);
+ traceline(this.warpzone_targetorigin, org, MOVE_NOMONSTERS, NULL);
else
trace_endpos = this.warpzone_targetorigin;
v_forward = vf;
// if we are near any warpzone planes - MOVE AWAY (work around nearclip)
entity e;
if(!warpzone_warpzones_exist)
- return world;
- for(e = world; (e = find(e, classname, "trigger_warpzone")); )
- if(WarpZoneLib_BoxTouchesBrush(mi, ma, e, world))
+ return NULL;
+ for(e = NULL; (e = find(e, classname, "trigger_warpzone")); )
+ if(WarpZoneLib_BoxTouchesBrush(mi, ma, e, NULL))
return e;
- return world;
+ return NULL;
}
void WarpZone_MakeAllSolid()
entity e;
if(!warpzone_warpzones_exist)
return;
- for(e = world; (e = find(e, classname, "trigger_warpzone")); )
+ for(e = NULL; (e = find(e, classname, "trigger_warpzone")); )
e.solid = SOLID_BSP;
}
entity e;
if(!warpzone_warpzones_exist)
return;
- for(e = world; (e = find(e, classname, "trigger_warpzone")); )
+ for(e = NULL; (e = find(e, classname, "trigger_warpzone")); )
e.solid = SOLID_TRIGGER;
}
vector vf, vr, vu;
WarpZone_trace_forent = forent;
- WarpZone_trace_firstzone = world;
- WarpZone_trace_lastzone = world;
+ WarpZone_trace_firstzone = NULL;
+ WarpZone_trace_lastzone = NULL;
WarpZone_Trace_InitTransform();
if(!warpzone_warpzones_exist)
{
if(--i < 1)
{
LOG_TRACE("Too many warpzones in sequence, aborting trace.\n");
- trace_ent = world;
+ trace_ent = NULL;
break;
}
tracebox(org, mi, ma, end, nomonsters_adjusted, WarpZone_trace_forent);
{
// FIXME can this check be removed? Do we really need it?
LOG_TRACE("I transformed into the same zone again, wtf, aborting the trace\n");
- trace_ent = world;
+ trace_ent = NULL;
break;
}
wz = trace_ent;
void WarpZone_TraceBox(vector org, vector mi, vector ma, vector end, float nomonsters, entity forent)
{
- WarpZone_TraceBox_ThroughZone(org, mi, ma, end, nomonsters, forent, world, WarpZone_trace_callback_t_null);
+ WarpZone_TraceBox_ThroughZone(org, mi, ma, end, nomonsters, forent, NULL, WarpZone_trace_callback_t_null);
}
void WarpZone_TraceLine(vector org, vector end, float nomonsters, entity forent)
g = cvar("sv_gravity") * e.gravity;
WarpZone_trace_forent = forent;
- WarpZone_trace_firstzone = world;
- WarpZone_trace_lastzone = world;
+ WarpZone_trace_firstzone = NULL;
+ WarpZone_trace_lastzone = NULL;
WarpZone_Trace_InitTransform();
WarpZone_tracetoss_time = 0;
if(!warpzone_warpzones_exist)
if(--i < 1)
{
LOG_TRACE("Too many warpzones in sequence, aborting trace.\n");
- trace_ent = world;
+ trace_ent = NULL;
break;
}
tracetoss(e, WarpZone_trace_forent);
{
// FIXME can this check be removed? Do we really need it?
LOG_TRACE("I transformed into the same zone again, wtf, aborting the trace\n");
- trace_ent = world;
+ trace_ent = NULL;
break;
}
wz = trace_ent;
void WarpZone_TraceToss(entity e, entity forent)
{
- WarpZone_TraceToss_ThroughZone(e, forent, world, WarpZone_trace_callback_t_null);
+ WarpZone_TraceToss_ThroughZone(e, forent, NULL, WarpZone_trace_callback_t_null);
}
entity WarpZone_TrailParticles_trace_callback_own;
{
WarpZone_TrailParticles_trace_callback_own = own;
WarpZone_TrailParticles_trace_callback_eff = eff;
- WarpZone_TraceBox_ThroughZone(org, '0 0 0', '0 0 0', end, MOVE_NOMONSTERS, world, world, WarpZone_TrailParticles_trace_callback);
+ WarpZone_TraceBox_ThroughZone(org, '0 0 0', '0 0 0', end, MOVE_NOMONSTERS, NULL, NULL, WarpZone_TrailParticles_trace_callback);
}
#ifdef CSQC
WarpZone_TrailParticles_trace_callback_eff = eff;
WarpZone_TrailParticles_trace_callback_f = f;
WarpZone_TrailParticles_trace_callback_flags = boxflags | PARTICLES_DRAWASTRAIL;
- WarpZone_TraceBox_ThroughZone(org, '0 0 0', '0 0 0', end, MOVE_NOMONSTERS, world, world, WarpZone_TrailParticles_WithMultiplier_trace_callback);
+ WarpZone_TraceBox_ThroughZone(org, '0 0 0', '0 0 0', end, MOVE_NOMONSTERS, NULL, NULL, WarpZone_TrailParticles_WithMultiplier_trace_callback);
}
#endif
if(me.WarpZone_refsys)
{
remove(me.WarpZone_refsys);
- me.WarpZone_refsys = world;
+ me.WarpZone_refsys = NULL;
}
}
void WarpZone_RefSys_AddTransform(entity me, vector t, vector s)
{
entity own;
own = player.owner;
- player.owner = world;
+ player.owner = NULL;
tracebox(trace_endpos, player.mins, player.maxs, o1 - player.view_ofs + v1 * frametime * f1, MOVE_NORMAL, player); // this should get us through the warpzone
player.owner = own;
}
{
if(this.killtarget != "")
{
- this.aiment = find(world, targetname, this.killtarget);
- if(this.aiment == world)
+ this.aiment = find(NULL, targetname, this.killtarget);
+ if(this.aiment == NULL)
{
error("Warp zone with nonexisting killtarget");
return;
error("Warp zone position with no target");
return;
}
- this.enemy = find(world, targetname, this.target);
- if(this.enemy == world)
+ this.enemy = find(NULL, targetname, this.target);
+ if(this.enemy == NULL)
{
error("Warp zone position with nonexisting target");
return;
error("Camera with no target");
return;
}
- this.enemy = world;
- for(e = world, i = 0; (e = find(e, targetname, this.target)); )
+ this.enemy = NULL;
+ for(e = NULL, i = 0; (e = find(e, targetname, this.target)); )
if(random() * ++i < 1)
this.enemy = e;
- if(this.enemy == world)
+ if(this.enemy == NULL)
{
error("Camera with nonexisting target");
return;
void WarpZone_InitStep_ClearTarget(entity this)
{
if(this.enemy)
- this.enemy.enemy = world;
- this.enemy = world;
+ this.enemy.enemy = NULL;
+ this.enemy = NULL;
}
entity warpzone_first; .entity warpzone_next;
{
this.enemy = this; // so the if(!e.enemy) check also skips this, saves one IF
- e2 = world;
- for(e = world, i = 0; (e = find(e, targetname, this.target)); )
+ e2 = NULL;
+ for(e = NULL, i = 0; (e = find(e, targetname, this.target)); )
if(!e.enemy)
if(e.classname == this.classname) // possibly non-warpzones may use the same targetname!
if(random() * ++i < 1)
e2 = e;
if(!e2)
{
- this.enemy = world;
+ this.enemy = NULL;
error("Warpzone with non-existing target");
return;
}
{
if(this.flags & FL_INWATER)
{
- this.bot_aimtarg = world;
+ this.bot_aimtarg = NULL;
return;
}
this.bot_aimtarg = e1;
// get the desired angles to aim at
//dprint(" at:", vtos(v));
v = normalize(v);
- //te_lightning2(world, this.origin + this.view_ofs, this.origin + this.view_ofs + v * 200);
+ //te_lightning2(NULL, this.origin + this.view_ofs, this.origin + this.view_ofs + v * 200);
if (time >= this.bot_badaimtime)
{
this.bot_badaimtime = max(this.bot_badaimtime + 0.3, time);
shotdir = v_forward;
//dprint(" dir:", vtos(v_forward));
- //te_lightning2(world, shotorg, shotorg + shotdir * 100);
+ //te_lightning2(NULL, shotorg, shotorg + shotdir * 100);
// calculate turn angles again
//diffang = desiredang - this.v_angle;
if ((normalize(v) * shotdir) >= cos(maxfiredeviation * (3.14159265358979323846 / 180)))
if(vdist(trace_endpos-shotorg, <, 500 + 500 * bound(0, skill + this.bot_aggresskill, 10)) || random()*random()>bound(0,(skill+this.bot_aggresskill)*0.05,1))
this.bot_firetimer = time + bound(0.1, 0.5-(skill+this.bot_aggresskill)*0.05, 0.5);
- //traceline(shotorg,shotorg+shotdir*1000,false,world);
+ //traceline(shotorg,shotorg+shotdir*1000,false,NULL);
//dprint(ftos(maxfiredeviation),"\n");
//dprint(" diff:", vtos(diffang), "\n");
this.dmg_take = 0;
this.dmg_save = 0;
- this.dmg_inflictor = world;
+ this.dmg_inflictor = NULL;
// calculate an aiming latency based on the skill setting
// (simulated network latency + naturally delayed reflexes)
break;
}
));
- RandomSelection_Add(world, 0, readfile, 1, prio);
+ RandomSelection_Add(NULL, 0, readfile, 1, prio);
}
readfile = RandomSelection_chosen_string;
fclose(file);
this.playermodel = this.playermodel_freeme = strzone(strcat("models/player/", bot_model));
this.playerskin = this.playerskin_freeme = strzone(bot_skin);
- this.cvar_cl_accuracy_data_share = 1; // share the bots weapon accuracy data with the world
+ this.cvar_cl_accuracy_data_share = 1; // share the bots weapon accuracy data with the NULL
this.cvar_cl_accuracy_data_receive = 0; // don't receive any weapon accuracy data
}
player_count = 0;
currentbots = 0;
player_list = e = findchainflags(flags, FL_CLIENT);
- bot_list = world;
- prevbot = world;
+ bot_list = NULL;
+ prevbot = NULL;
while (e)
{
player_count = player_count + 1;
else
{
bot_list = e;
- bot_list.nextbot = world;
+ bot_list.nextbot = NULL;
}
prevbot = e;
currentbots = currentbots + 1;
if(this.bot_cmd_current)
remove(this.bot_cmd_current);
if(bot_waypoint_queue_owner==this)
- bot_waypoint_queue_owner = world;
+ bot_waypoint_queue_owner = NULL;
}
void bot_clientconnect(entity this)
{
float besttime, bestcount, thiscount;
entity best, head;
- CheckAllowedTeams(world);
- GetTeamCounts(world);
+ CheckAllowedTeams(NULL);
+ GetTeamCounts(NULL);
head = findchainfloat(isbot, true);
if (!head)
return;
//dprint(ftos(bots), " ? ", ftos(currentbots), "\n");
while (currentbots < bots)
{
- if (bot_spawn() == world)
+ if (bot_spawn() == NULL)
{
bprint("Can not add bot, server full.\n");
return false;
// TODO: tracewalk() should take care of this job (better path finding under water)
// if we don't have a goal and we're under water look for a waypoint near the "shore" and push it
if(IS_DEAD(this))
- if(this.goalcurrent==world)
+ if(this.goalcurrent==NULL)
if(this.waterlevel==WATERLEVEL_SWIMMING || (this.aistatus & AI_STATUS_OUT_WATER))
{
// Look for the closest waypoint out of water
entity newgoal, head;
float bestdistance, distance;
- newgoal = world;
+ newgoal = NULL;
bestdistance = 10000;
for (head = findchain(classname, "waypoint"); head; head = head.chain)
{
//heading = this.velocity;
//dprint(this.goalstack01.classname,etos(this.goalstack01),"\n");
if(
- this.goalstack01 != this && this.goalstack01 != world && ((this.aistatus & AI_STATUS_RUNNING) == 0) &&
+ this.goalstack01 != this && this.goalstack01 != NULL && ((this.aistatus & AI_STATUS_RUNNING) == 0) &&
!(this.goalcurrent.wpflags & WAYPOINTFLAG_TELEPORT)
)
next = ((this.goalstack01.absmin + this.goalstack01.absmax) * 0.5) - (this.origin + this.view_ofs);
if (this.waterlevel < WATERLEVEL_SWIMMING)
v.z = 0;
//dprint("walk at:", vtos(v), "\n");
- //te_lightning2(world, this.origin, this.goalcurrent.origin);
+ //te_lightning2(NULL, this.origin, this.goalcurrent.origin);
bot_aimdir(this, v, -1);
}
havocbot_movetogoal(this);
if(this.goalcurrent.classname=="waypoint")
if (!(this.goalcurrent.wpflags & WAYPOINTFLAG_PERSONAL))
if(fabs(gco.z - this.origin.z) < this.maxs.z - this.mins.z)
- if(this.goalstack01!=world)
+ if(this.goalstack01!=NULL)
{
gno = (this.goalstack01.absmin + this.goalstack01.absmax) * 0.5;
deviation = vectoangles(gno - this.origin) - vectoangles(gco - this.origin);
return;
}
// Switch to normal mode
- this.navigation_jetpack_goal = world;
+ this.navigation_jetpack_goal = NULL;
this.aistatus &= ~AI_STATUS_JETPACK_LANDING;
this.aistatus &= ~AI_STATUS_JETPACK_FLYING;
return;
{
if(fabs(this.velocity.z)<50)
{
- entity head, newgoal = world;
+ entity head, newgoal = NULL;
float distance, bestdistance = 0;
for (head = findchain(classname, "waypoint"); head; head = head.chain)
if(distance>1000)
continue;
- traceline(this.origin + this.view_ofs , ( ( head.absmin + head.absmax ) * 0.5 ), true, world);
+ traceline(this.origin + this.view_ofs , ( ( head.absmin + head.absmax ) * 0.5 ), true, NULL);
if(trace_fraction<1)
continue;
// If there is no goal try to move forward
- if(this.goalcurrent==world)
+ if(this.goalcurrent==NULL)
dir = v_forward;
else
dir = normalize(( ( this.goalcurrent.absmin + this.goalcurrent.absmax ) * 0.5 ) - this.origin);
else
{
// If there is no goal try to move forward
- if(this.goalcurrent==world)
+ if(this.goalcurrent==NULL)
this.movement_x = maxspeed;
}
}
// If we are under water with no goals, swim up
if(this.waterlevel)
- if(this.goalcurrent==world)
+ if(this.goalcurrent==NULL)
{
dir = '0 0 0';
if(this.waterlevel>WATERLEVEL_SWIMMING)
}
// if there is nowhere to go, exit
- if (this.goalcurrent == world)
+ if (this.goalcurrent == NULL)
return;
if (this.goalcurrent)
navigation_poptouchedgoals(this);
// if ran out of goals try to use an alternative goal or get a new strategy asap
- if(this.goalcurrent == world)
+ if(this.goalcurrent == NULL)
{
this.bot_strategytime = 0;
return;
dst_down = dst_ahead - '0 0 1500';
// Look ahead
- traceline(this.origin + this.view_ofs, dst_ahead, true, world);
+ traceline(this.origin + this.view_ofs, dst_ahead, true, NULL);
// Check head-banging against walls
if(vdist(this.origin + this.view_ofs - trace_endpos, <, 25) && !(this.aistatus & AI_STATUS_OUT_WATER))
{
this.facingwalltime = 0;
- if(this.ignoregoal != world && time > this.ignoregoaltime)
+ if(this.ignoregoal != NULL && time > this.ignoregoaltime)
{
- this.ignoregoal = world;
+ this.ignoregoal = NULL;
this.ignoregoaltime = 0;
}
}
if((IS_ONGROUND(this)) || (this.aistatus & AI_STATUS_RUNNING) || PHYS_INPUT_BUTTON_JUMP(this))
{
// Look downwards
- traceline(dst_ahead , dst_down, true, world);
- // te_lightning2(world, this.origin, dst_ahead); // Draw "ahead" look
- // te_lightning2(world, dst_ahead, dst_down); // Draw "downwards" look
+ traceline(dst_ahead , dst_down, true, NULL);
+ // te_lightning2(NULL, this.origin, dst_ahead); // Draw "ahead" look
+ // te_lightning2(NULL, dst_ahead, dst_down); // Draw "downwards" look
if(trace_endpos.z < this.origin.z + this.mins.z)
{
s = pointcontents(trace_endpos + '0 0 1');
dodge = havocbot_dodge(this);
dodge = dodge * bound(0,0.5+(skill+this.bot_dodgeskill)*0.1,1);
evadelava = evadelava * bound(1,3-(skill+this.bot_dodgeskill),3); //Noobs fear lava a lot and take more distance from it
- traceline(this.origin, ( ( this.enemy.absmin + this.enemy.absmax ) * 0.5 ), true, world);
+ traceline(this.origin, ( ( this.enemy.absmin + this.enemy.absmax ) * 0.5 ), true, NULL);
if(IS_PLAYER(trace_ent))
dir = dir * bound(0,(skill+this.bot_dodgeskill)/7,1);
vector eye, v;
if (autocvar_bot_nofire || IS_INDEPENDENT_PLAYER(this))
{
- this.enemy = world;
+ this.enemy = NULL;
return;
}
if (this.enemy)
if (!bot_shouldattack(this, this.enemy))
{
// enemy died or something, find a new target
- this.enemy = world;
+ this.enemy = NULL;
this.havocbot_chooseenemy_finished = time;
}
else if (this.havocbot_stickenemy)
// and not really really far away
// and we're not severely injured
// then keep tracking for a half second into the future
- traceline(this.origin+this.view_ofs, ( this.enemy.absmin + this.enemy.absmax ) * 0.5,false,world);
+ traceline(this.origin+this.view_ofs, ( this.enemy.absmin + this.enemy.absmax ) * 0.5,false,NULL);
if (trace_ent == this.enemy || trace_fraction == 1)
if (vdist(((this.enemy.absmin + this.enemy.absmax) * 0.5) - this.origin, <, 1000))
if (this.health > 30)
return;
this.havocbot_chooseenemy_finished = time + autocvar_bot_ai_enemydetectioninterval;
eye = this.origin + this.view_ofs;
- best = world;
+ best = NULL;
bestrating = 100000000;
head = head2 = findchainfloat(bot_attack, true);
}
// TODO: clean this up by moving it to weapon code
- if(this.enemy==world)
+ if(this.enemy==NULL)
{
// If no weapon was chosen get the first available weapon
if(PS(this).m_weapon==WEP_Null)
lag_additem(this, time + this.ping, 0, 0, this.enemy, this.origin, myvel, (this.enemy.absmin + this.enemy.absmax) * 0.5, enemyvel);
}
else
- lag_additem(this, time + this.ping, 0, 0, world, this.origin, myvel, ( this.goalcurrent.absmin + this.goalcurrent.absmax ) * 0.5, '0 0 0');
+ lag_additem(this, time + this.ping, 0, 0, NULL, this.origin, myvel, ( this.goalcurrent.absmin + this.goalcurrent.absmax ) * 0.5, '0 0 0');
}
bool havocbot_moveto_refresh_route(entity this)
if(this.aistatus & AI_STATUS_WAYPOINT_PERSONAL_GOING)
{
// Step 4: Move to waypoint
- if(this.havocbot_personal_waypoint==world)
+ if(this.havocbot_personal_waypoint==NULL)
{
LOG_TRACE("Error: ", this.netname, " trying to walk to a non existent personal waypoint\n");
this.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_GOING;
// Step 1: Spawning waypoint
wp = waypoint_spawnpersonal(this, pos);
- if(wp==world)
+ if(wp==NULL)
{
LOG_TRACE("Error: Can't spawn personal waypoint at ",vtos(pos),"\n");
return CMD_STATUS_ERROR;
// if pos is inside a teleport, then let's mark it as teleport waypoint
entity head;
- for(head = world; (head = find(head, classname, "trigger_teleport")); )
+ for(head = NULL; (head = find(head, classname, "trigger_teleport")); )
{
- if(WarpZoneLib_BoxTouchesBrush(pos, pos, head, world))
+ if(WarpZoneLib_BoxTouchesBrush(pos, pos, head, NULL))
{
wp.wpflags |= WAYPOINTFLAG_TELEPORT;
this.lastteleporttime = 0;
// Check if the item can be picked up safely
if(head.classname == "droppedweapon")
{
- traceline(o, o + '0 0 -1500', true, world);
+ traceline(o, o + '0 0 -1500', true, NULL);
d = pointcontents(trace_endpos + '0 0 1');
if(d & CONTENT_WATER || d & CONTENT_SLIME || d & CONTENT_LAVA)
// not falling
if((IS_ONGROUND(it)) == 0)
{
- traceline(it.origin, it.origin + '0 0 -1500', true, world);
+ traceline(it.origin, it.origin + '0 0 -1500', true, NULL);
t = pointcontents(trace_endpos + '0 0 1');
if(t != CONTENT_SOLID )
if(t & CONTENT_WATER || t & CONTENT_SLIME || t & CONTENT_LAVA)
{
//print("bot ", etos(this), " clear\n");
this.navigation_hasgoals = false;
- this.goalcurrent = world;
- this.goalstack01 = world;
- this.goalstack02 = world;
- this.goalstack03 = world;
- this.goalstack04 = world;
- this.goalstack05 = world;
- this.goalstack06 = world;
- this.goalstack07 = world;
- this.goalstack08 = world;
- this.goalstack09 = world;
- this.goalstack10 = world;
- this.goalstack11 = world;
- this.goalstack12 = world;
- this.goalstack13 = world;
- this.goalstack14 = world;
- this.goalstack15 = world;
- this.goalstack16 = world;
- this.goalstack17 = world;
- this.goalstack18 = world;
- this.goalstack19 = world;
- this.goalstack20 = world;
- this.goalstack21 = world;
- this.goalstack22 = world;
- this.goalstack23 = world;
- this.goalstack24 = world;
- this.goalstack25 = world;
- this.goalstack26 = world;
- this.goalstack27 = world;
- this.goalstack28 = world;
- this.goalstack29 = world;
- this.goalstack30 = world;
- this.goalstack31 = world;
+ this.goalcurrent = NULL;
+ this.goalstack01 = NULL;
+ this.goalstack02 = NULL;
+ this.goalstack03 = NULL;
+ this.goalstack04 = NULL;
+ this.goalstack05 = NULL;
+ this.goalstack06 = NULL;
+ this.goalstack07 = NULL;
+ this.goalstack08 = NULL;
+ this.goalstack09 = NULL;
+ this.goalstack10 = NULL;
+ this.goalstack11 = NULL;
+ this.goalstack12 = NULL;
+ this.goalstack13 = NULL;
+ this.goalstack14 = NULL;
+ this.goalstack15 = NULL;
+ this.goalstack16 = NULL;
+ this.goalstack17 = NULL;
+ this.goalstack18 = NULL;
+ this.goalstack19 = NULL;
+ this.goalstack20 = NULL;
+ this.goalstack21 = NULL;
+ this.goalstack22 = NULL;
+ this.goalstack23 = NULL;
+ this.goalstack24 = NULL;
+ this.goalstack25 = NULL;
+ this.goalstack26 = NULL;
+ this.goalstack27 = NULL;
+ this.goalstack28 = NULL;
+ this.goalstack29 = NULL;
+ this.goalstack30 = NULL;
+ this.goalstack31 = NULL;
}
// add a new goal at the beginning of the stack
this.goalstack28 = this.goalstack29;
this.goalstack29 = this.goalstack30;
this.goalstack30 = this.goalstack31;
- this.goalstack31 = world;
+ this.goalstack31 = NULL;
}
float navigation_waypoint_will_link(vector v, vector org, entity ent, float walkfromwp, float bestdist)
if (navigation_testtracewalk)
te_plasmaburn(org);
- best = world;
+ best = NULL;
// box check failed, try walk
w = waylist;
}
entity navigation_findnearestwaypoint(entity ent, float walkfromwp)
{
- entity wp = navigation_findnearestwaypoint_withdist_except(ent, walkfromwp, 1050, world);
+ entity wp = navigation_findnearestwaypoint_withdist_except(ent, walkfromwp, 1050, NULL);
if (autocvar_g_waypointeditor_auto)
{
entity wp2 = navigation_findnearestwaypoint_withdist_except(ent, walkfromwp, 1050, wp);
head.wpnearestpoint = v;
head.wpcost = vlen(v - this.origin) + head.dmg;
head.wpfire = 1;
- head.enemy = world;
+ head.enemy = NULL;
c = c + 1;
}
}
w.wpnearestpoint = '0 0 0';
w.wpcost = 10000000;
w.wpfire = 0;
- w.enemy = world;
+ w.enemy = NULL;
w = w.chain;
}
fixed_source_waypoint.wpnearestpoint = fixed_source_waypoint.origin + 0.5 * (fixed_source_waypoint.mins + fixed_source_waypoint.maxs);
fixed_source_waypoint.wpcost = fixed_source_waypoint.dmg;
fixed_source_waypoint.wpfire = 1;
- fixed_source_waypoint.enemy = world;
+ fixed_source_waypoint.enemy = NULL;
}
else
{
w.wpnearestpoint = '0 0 0';
w.wpcost = 10000000;
w.wpfire = 0;
- w.enemy = world;
+ w.enemy = NULL;
w = w.chain;
}
fixed_source_waypoint.wpnearestpoint = fixed_source_waypoint.origin + 0.5 * (fixed_source_waypoint.mins + fixed_source_waypoint.maxs);
fixed_source_waypoint.wpcost = fixed_source_waypoint.dmg; // the cost to get from X to fixed_source_waypoint
fixed_source_waypoint.wpfire = 1;
- fixed_source_waypoint.enemy = world;
+ fixed_source_waypoint.enemy = NULL;
}
else
{
else
e = e.enemy; // we already have added it, so...
- if(e == world)
+ if(e == NULL)
return false;
for (;;)
navigation_pushroute(this, e);
e = e.enemy;
- if(e==world)
+ if(e==NULL)
break;
}
{
if(vdist(this.origin - this.goalcurrent.origin, <, 150))
{
- traceline(this.origin + this.view_ofs , this.goalcurrent.origin, true, world);
+ traceline(this.origin + this.view_ofs , this.goalcurrent.origin, true, NULL);
if(trace_fraction==1)
{
// Detect personal waypoints
if(this.aistatus & AI_STATUS_STUCK)
return;
- this.navigation_jetpack_goal = world;
+ this.navigation_jetpack_goal = NULL;
navigation_bestrating = -1;
this.navigation_hasgoals = false;
navigation_clearroute(this);
- navigation_bestgoal = world;
- navigation_markroutes(this, world);
+ navigation_bestgoal = NULL;
+ navigation_markroutes(this, NULL);
}
// ends a goal selection session (updates goal stack to the best goal)
c = 0;
bot_dodgelist = findchainfloat(bot_dodge, true);
botframe_dangerwaypoint = find(botframe_dangerwaypoint, classname, "waypoint");
- while (botframe_dangerwaypoint != world)
+ while (botframe_dangerwaypoint != NULL)
{
danger = 0;
m1 = botframe_dangerwaypoint.mins;
d = head.bot_dodgerating - vlen(o - v);
if (d > 0)
{
- traceline(o, v, true, world);
+ traceline(o, v, true, NULL);
if (trace_fraction == 1)
danger = danger + d;
}
{
LOG_DEBUG(strcat(this.netname, " sutck, taking over the waypoints queue\n"));
bot_waypoint_queue_owner = this;
- bot_waypoint_queue_bestgoal = world;
+ bot_waypoint_queue_bestgoal = NULL;
bot_waypoint_queue_bestgoalrating = 0;
}
LOG_DEBUG(strcat(this.netname, " stuck, cannot walk to any waypoint at all\n"));
}
- bot_waypoint_queue_owner = world;
+ bot_waypoint_queue_owner = NULL;
}
}
else
entity head, first;
- first = world;
+ first = NULL;
head = findradius(this.origin, search_radius);
while(head)
first = head;
bot_waypoint_queue_goal = head;
- bot_waypoint_queue_goal.bot_waypoint_queue_nextgoal = world;
+ bot_waypoint_queue_goal.bot_waypoint_queue_nextgoal = NULL;
}
head = head.chain;
else
{
LOG_DEBUG(strcat(this.netname, " stuck, cannot walk to any waypoint at all\n"));
- bot_waypoint_queue_owner = world;
+ bot_waypoint_queue_owner = NULL;
}
}
}
return;
}
- te_lightning2(world, node, debuglastnode);
+ te_lightning2(NULL, node, debuglastnode);
debuglastnode = node;
}
else if(this.goalcounter==29)goal=this.goalstack29;
else if(this.goalcounter==30)goal=this.goalstack30;
else if(this.goalcounter==31)goal=this.goalstack31;
- else goal=world;
+ else goal=NULL;
- if(goal==world)
+ if(goal==NULL)
{
this.goalcounter = 0;
this.lastposition='0 0 0';
go = ( goal.absmin + goal.absmax ) * 0.5;
- te_lightning2(world, org, go);
+ te_lightning2(NULL, org, go);
this.lastposition = go;
this.goalcounter++;
cvar_set(placename, strcat(substring(s2, p+1, -1), " ", s));
//print("places: ", placename, " := ", cvar_string(placename), "\n");
}
- e = find(world, targetname, s);
+ e = find(NULL, targetname, s);
if(!e)
LOG_INFO("invalid place ", s, "\n");
if(i < MAX_BOT_PLACES)
}
else
{
- e = find(world, targetname, placename);
+ e = find(NULL, targetname, placename);
if(!e)
LOG_INFO("invalid place ", placename, "\n");
return e;
bot = bot.chain;
}
- return world;
+ return NULL;
}
// Returns a bot by number on list
float c = 0;
if(!number)
- return world;
+ return NULL;
bot = findchainflags(flags, FL_CLIENT);
while (bot)
bot = bot.chain;
}
- return world;
+ return NULL;
}
float bot_decodecommand(string cmdstring)
case "speed":
return vlen(this.velocity);
case "flagcarrier":
- return ((this.flagcarried!=world));
+ return ((this.flagcarried!=NULL));
}
LOG_INFO(strcat("ERROR: Unable to convert the expression '",expr,"' into a numeric value\n"));
void bot_setcurrentcommand(entity this)
{
- bot_cmd = world;
+ bot_cmd = NULL;
if(!this.bot_cmd_current)
{
else
{
// Invalid command, remove from queue
- bot_cmd = world;
+ bot_cmd = NULL;
bot_dequeuecommand(this, this.bot_cmd_execution_index);
this.bot_cmd_execution_index++;
}
}
else
- bot_cmd = world;
+ bot_cmd = NULL;
}
}
// old logic kept pressing previously pressed keys, but that has problems
// (namely, it means you cannot make a bot "normal" ever again)
// to keep a bot walking for a while, use the "wait" bot command
- if(bot_cmd == world)
+ if(bot_cmd == NULL)
return false;
// Ignore all commands except continue when the bot is paused
entity waypoint_spawn(vector m1, vector m2, float f)
{
entity w;
- w = find(world, classname, "waypoint");
+ w = find(NULL, classname, "waypoint");
if (!(f & WAYPOINTFLAG_PERSONAL))
while (w)
{
LOG_TRACE("Killed a waypoint that was stuck in solid at ", vtos(w.origin), "\n");
remove(w);
- return world;
+ return NULL;
}
else
{
//dprint("waypoint_think wpisbox = ", ftos(this.wpisbox), "\n");
sm1 = this.origin + this.mins;
sm2 = this.origin + this.maxs;
- for(e = world; (e = find(e, classname, "waypoint")); )
+ for(e = NULL; (e = find(e, classname, "waypoint")); )
{
if (boxesoverlap(this.absmin, this.absmax, e.absmin, e.absmax))
{
ev = trace_endpos + '0 0 1';
}
}
- //traceline(this.origin, e.origin, false, world);
+ //traceline(this.origin, e.origin, false, NULL);
//if (trace_fraction == 1)
if (!this.wpisbox && tracewalk(this, sv, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), ev, MOVE_NOMONSTERS))
waypoint_addlink(this, e);
// clear links to other waypoints
float f;
f = 10000000;
- wp.wp00 = wp.wp01 = wp.wp02 = wp.wp03 = wp.wp04 = wp.wp05 = wp.wp06 = wp.wp07 = world;
- wp.wp08 = wp.wp09 = wp.wp10 = wp.wp11 = wp.wp12 = wp.wp13 = wp.wp14 = wp.wp15 = world;
- wp.wp16 = wp.wp17 = wp.wp18 = wp.wp19 = wp.wp20 = wp.wp21 = wp.wp22 = wp.wp23 = world;
- wp.wp24 = wp.wp25 = wp.wp26 = wp.wp27 = wp.wp28 = wp.wp29 = wp.wp30 = wp.wp31 = world;
+ wp.wp00 = wp.wp01 = wp.wp02 = wp.wp03 = wp.wp04 = wp.wp05 = wp.wp06 = wp.wp07 = NULL;
+ wp.wp08 = wp.wp09 = wp.wp10 = wp.wp11 = wp.wp12 = wp.wp13 = wp.wp14 = wp.wp15 = NULL;
+ wp.wp16 = wp.wp17 = wp.wp18 = wp.wp19 = wp.wp20 = wp.wp21 = wp.wp22 = wp.wp23 = NULL;
+ wp.wp24 = wp.wp25 = wp.wp26 = wp.wp27 = wp.wp28 = wp.wp29 = wp.wp30 = wp.wp31 = NULL;
wp.wp00mincost = wp.wp01mincost = wp.wp02mincost = wp.wp03mincost = wp.wp04mincost = wp.wp05mincost = wp.wp06mincost = wp.wp07mincost = f;
wp.wp08mincost = wp.wp09mincost = wp.wp10mincost = wp.wp11mincost = wp.wp12mincost = wp.wp13mincost = wp.wp14mincost = wp.wp15mincost = f;
// tell a spawnfunc_waypoint to relink
void waypoint_schedulerelink(entity wp)
{
- if (wp == world)
+ if (wp == NULL)
return;
// TODO: add some sort of visible box in edit mode for box waypoints
if (autocvar_g_waypointeditor)
else
wp.model = "";
wp.wpisbox = vlen(wp.size) > 0;
- wp.enemy = world;
+ wp.enemy = NULL;
if (!(wp.wpflags & WAYPOINTFLAG_PERSONAL))
- wp.owner = world;
+ wp.owner = NULL;
if (!(wp.wpflags & WAYPOINTFLAG_NORELINK))
waypoint_clearlinks(wp);
// schedule an actual relink on next frame
{
string filename, s;
float file, tokens, c = 0, found;
- entity wp_from = world, wp_to;
+ entity wp_from = NULL, wp_to;
vector wp_to_pos, wp_from_pos;
filename = strcat("maps/", mapname);
filename = strcat(filename, ".waypoints.cache");
{
string filename, s;
float file, tokens, c = 0, found;
- entity wp_from = world, wp_to;
+ entity wp_from = NULL, wp_to;
vector wp_to_pos, wp_from_pos;
filename = strcat("maps/", mapname);
filename = strcat(filename, ".waypoints.hardwired");
case 29:return w.wp29;
case 30:return w.wp30;
case 31:return w.wp31;
- default:return world;
+ default:return NULL;
}
}
{
// :S
link = waypoint_get_link(w, i);
- if(link==world)
+ if(link==NULL)
continue;
s = strcat(vtos(w.origin), "*", vtos(link.origin), "\n");
vector waypoint_fixorigin(vector position)
{
- tracebox(position + '0 0 1' * (1 - STAT(PL_MIN, NULL).z), STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), position + '0 0 -512', MOVE_NOMONSTERS, world);
+ tracebox(position + '0 0 1' * (1 - STAT(PL_MIN, NULL).z), STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), position + '0 0 -512', MOVE_NOMONSTERS, NULL);
if(trace_fraction < 1)
position = trace_endpos;
- //traceline(position, position + '0 0 -512', MOVE_NOMONSTERS, world);
+ //traceline(position, position + '0 0 -512', MOVE_NOMONSTERS, NULL);
//print("position is ", ftos(trace_endpos_z - position_z), " above solid\n");
return position;
}
position = waypoint_fixorigin(position);
w = waypoint_spawn(position, position, WAYPOINTFLAG_GENERATED | WAYPOINTFLAG_PERSONAL);
- w.nearestwaypoint = world;
+ w.nearestwaypoint = NULL;
w.nearestwaypointtimeout = 0;
w.owner = this;
//navigation_testtracewalk = false;
if (head)
{
- w = head ;if (w) te_lightning2(world, w.origin, it.origin);
- w = head.wp00;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp01;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp02;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp03;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp04;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp05;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp06;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp07;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp08;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp09;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp10;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp11;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp12;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp13;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp14;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp15;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp16;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp17;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp18;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp19;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp20;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp21;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp22;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp23;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp24;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp25;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp26;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp27;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp28;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp29;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp30;if (w) te_lightning2(world, w.origin, head.origin);
- w = head.wp31;if (w) te_lightning2(world, w.origin, head.origin);
+ w = head ;if (w) te_lightning2(NULL, w.origin, it.origin);
+ w = head.wp00;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp01;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp02;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp03;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp04;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp05;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp06;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp07;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp08;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp09;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp10;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp11;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp12;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp13;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp14;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp15;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp16;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp17;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp18;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp19;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp20;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp21;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp22;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp23;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp24;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp25;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp26;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp27;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp28;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp29;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp30;if (w) te_lightning2(NULL, w.origin, head.origin);
+ w = head.wp31;if (w) te_lightning2(NULL, w.origin, head.origin);
}
}
));
float botframe_autowaypoints_fixdown(vector v)
{
- tracebox(v, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), v + '0 0 -64', MOVE_NOMONSTERS, world);
+ tracebox(v, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), v + '0 0 -64', MOVE_NOMONSTERS, NULL);
if(trace_fraction >= 1)
return 0;
return 1;
{
entity w;
- w = find(world, classname, "waypoint");
+ w = find(NULL, classname, "waypoint");
while (w)
{
// if a matching spawnfunc_waypoint already exists, don't add a duplicate
float botframe_autowaypoints_fix_from(entity p, float walkfromwp, entity wp, .entity fld)
{
// make it possible to go from p to wp, if we can
- // if wp is world, nearest is chosen
+ // if wp is NULL, nearest is chosen
entity w;
vector porg;
float bestdist;
bestdist = maxdist;
- w = find(world, classname, "waypoint");
+ w = find(NULL, classname, "waypoint");
while (w)
{
if(w != wp && !(w.wpflags & WAYPOINTFLAG_NORELINK))
float r = botframe_autowaypoints_fix_from(p, walkfromwp, p.(fld), fld);
if(r != -1)
return;
- r = botframe_autowaypoints_fix_from(p, walkfromwp, world, fld);
+ r = botframe_autowaypoints_fix_from(p, walkfromwp, NULL, fld);
if(r != -1)
return;
{
entity w, w1, w2;
float i, j, k;
- for (w = world; (w = findfloat(w, bot_pickup, true)); )
+ for (w = NULL; (w = findfloat(w, bot_pickup, true)); )
{
// NOTE: this protects waypoints if they're the ONLY nearest
// waypoint. That's the intention.
navigation_findnearestwaypoint(w, false); // Walk TO item.
navigation_findnearestwaypoint(w, true); // Walk FROM item.
}
- for (w = world; (w = find(w, classname, "waypoint")); )
+ for (w = NULL; (w = find(w, classname, "waypoint")); )
{
w.wpflags |= WAYPOINTFLAG_DEAD_END;
w.wpflags &= ~WAYPOINTFLAG_USEFUL;
// This has been done above by protecting these WPs.
}
// c) There are w1, w, w2 so that w1 -> w, w -> w2 and not w1 -> w2.
- for (w1 = world; (w1 = find(w1, classname, "waypoint")); )
+ for (w1 = NULL; (w1 = find(w1, classname, "waypoint")); )
{
if (w1.wpflags & WAYPOINTFLAG_PERSONAL)
continue;
// d) The waypoint is a dead end. Dead end waypoints must be kept as
// they are needed to complete routes while autowaypointing.
- for (w = world; (w = find(w, classname, "waypoint")); )
+ for (w = NULL; (w = find(w, classname, "waypoint")); )
{
if (!(w.wpflags & (WAYPOINTFLAG_USEFUL | WAYPOINTFLAG_DEAD_END)))
{
break;
}
}
- for (w = world; (w = find(w, classname, "waypoint")); )
+ for (w = NULL; (w = find(w, classname, "waypoint")); )
w.wpflags &= ~(WAYPOINTFLAG_USEFUL | WAYPOINTFLAG_DEAD_END); // temp flag
}
void info_autoscreenshot_findtarget(entity this)
{
entity e;
- e = find(world, targetname, this.target);
+ e = find(NULL, targetname, this.target);
if(!e)
{
objerror(this, "Missing target. FAIL!");
IS_CHEAT(this, imp, 0, 0);
if(this.movetype == MOVETYPE_NOCLIP)
{
- e = find(world, classname, "info_autoscreenshot");
+ e = find(NULL, classname, "info_autoscreenshot");
if(e)
{
sprint(this, "Emergency teleport used info_autoscreenshot location\n");
e2 = spawn();
setorigin(e2, e.origin);
- RadiusDamage(e2, this, 1000, 0, 128, world, world, 500, DEATH_CHEAT.m_id, e);
+ RadiusDamage(e2, this, 1000, 0, 128, NULL, NULL, 500, DEATH_CHEAT.m_id, e);
remove(e2);
LOG_INFO("404 Sportsmanship not found.\n");
IS_CHEAT(this, 0, argc, 0);
RandomSelection_Init();
crosshair_trace(this);
- for(entity e = world; (e = find(e, classname, "dragbox_box")); )
+ for(entity e = NULL; (e = find(e, classname, "dragbox_box")); )
RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos));
- for(entity e = world; (e = find(e, classname, "dragpoint")); )
+ for(entity e = NULL; (e = find(e, classname, "dragpoint")); )
RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos));
if(RandomSelection_chosen_ent)
{
{
RandomSelection_Init();
crosshair_trace(this);
- for(entity e = world; (e = find(e, classname, "dragbox_box")); )
+ for(entity e = NULL; (e = find(e, classname, "dragbox_box")); )
RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos));
- for(entity e = world; (e = find(e, classname, "dragpoint")); )
+ for(entity e = NULL; (e = find(e, classname, "dragpoint")); )
RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos));
if(RandomSelection_chosen_ent)
{
{
f = fopen(argv(1), FILE_WRITE);
fputs(f, "cmd drag_clear\n");
- for(entity e = world; (e = find(e, classname, "dragbox_box")); )
+ for(entity e = NULL; (e = find(e, classname, "dragbox_box")); )
{
fputs(f, strcat("cmd dragbox_spawn ", ftos(e.cnt), " \"", vtos(e.aiment.origin), "\" \"", vtos(e.enemy.origin), "\"\n"));
}
- for(entity e = world; (e = find(e, classname, "dragpoint")); )
+ for(entity e = NULL; (e = find(e, classname, "dragpoint")); )
{
fputs(f, strcat("cmd dragpoint_spawn ", ftos(e.cnt), " \"", vtos(e.origin), "\"\n"));
}
if(argc == 2)
{
f = fopen(argv(1), FILE_WRITE);
- for(entity e = world; (e = find(e, classname, "dragbox_box")); )
+ for(entity e = NULL; (e = find(e, classname, "dragbox_box")); )
{
fputs(f, "{\n");
fputs(f, "\"classname\" \"trigger_race_checkpoint\"\n");
fputs(f, strcat("\"targetname\" \"checkpoint", ftos(e.cnt), "\"\n"));
fputs(f, "}\n");
}
- for(entity e = world; (e = find(e, classname, "dragpoint")); )
+ for(entity e = NULL; (e = find(e, classname, "dragpoint")); )
{
start = '0 0 0';
effectnum = 0;
- for(entity ent = world; (ent = find(ent, classname, "dragbox_box")); )
+ for(entity ent = NULL; (ent = find(ent, classname, "dragbox_box")); )
{
if(e.cnt <= 0 && ent.cnt == 0 || e.cnt == ent.cnt)
{
// these need race_place
// counting...
effectnum = 1;
- for(entity ent = world; (ent = find(ent, classname, "dragpoint")); )
+ for(entity ent = NULL; (ent = find(ent, classname, "dragpoint")); )
if(ent.cnt == 0)
{
if(vlen2(ent.origin - start) < vlen2(e.origin - start))
break;
case "drag_clear":
IS_CHEAT(this, 0, argc, 0);
- for(entity e = world; (e = find(e, classname, "dragbox_box")); )
+ for(entity e = NULL; (e = find(e, classname, "dragbox_box")); )
remove(e);
- for(entity e = world; (e = find(e, classname, "dragbox_corner_1")); )
+ for(entity e = NULL; (e = find(e, classname, "dragbox_corner_1")); )
remove(e);
- for(entity e = world; (e = find(e, classname, "dragbox_corner_2")); )
+ for(entity e = NULL; (e = find(e, classname, "dragbox_corner_2")); )
remove(e);
- for(entity e = world; (e = find(e, classname, "dragpoint")); )
+ for(entity e = NULL; (e = find(e, classname, "dragpoint")); )
remove(e);
- for(entity e = world; (e = find(e, classname, "drag_digit")); )
+ for(entity e = NULL; (e = find(e, classname, "drag_digit")); )
remove(e);
DID_CHEAT();
break;
entity draggee;
draggee = dragger.dragentity;
if(dragger)
- dragger.dragentity = world;
- draggee.draggedby = world;
+ dragger.dragentity = NULL;
+ draggee.draggedby = NULL;
draggee.movetype = draggee.dragmovetype;
draggee.gravity = draggee.draggravity;
float Drag_IsDraggable(entity draggee)
{
// TODO add more checks for bad stuff here
- if(draggee == world)
+ if(draggee == NULL)
return false;
if(draggee.classname == "func_bobbing")
return false;
return false;
if(wasfreed(dragger.dragentity) || dragger.dragentity.draggedby != dragger)
{
- dragger.dragentity = world;
+ dragger.dragentity = NULL;
return false;
}
if(!Drag_CanDrag(dragger) || !Drag_IsDraggable(dragger.dragentity))
{
to.draggedby = from.draggedby;
to.draggedby.dragentity = to;
- from.draggedby = world;
+ from.draggedby = NULL;
}
}
if (this.killcount != FRAGS_SPECTATOR)
{
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_QUIT_SPECTATE, this.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_SPECTATE, this.netname);
if(!intermission_running)
if(autocvar_g_chat_nospectators == 1 || (!(warmup_stage || gameover) && autocvar_g_chat_nospectators == 2))
Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_CHAT_NOSPECTATORS);
if(this.killindicator && !wasfreed(this.killindicator))
remove(this.killindicator);
- this.killindicator = world;
+ this.killindicator = NULL;
if(this.killindicator_teamchange)
ClientKill_Now_TeamChange(this);
{
if (gameover)
{
- this.owner.killindicator = world;
+ this.owner.killindicator = NULL;
remove(this);
return;
}
if (this.owner.alpha < 0 && !this.owner.vehicle)
{
- this.owner.killindicator = world;
+ this.owner.killindicator = NULL;
remove(this);
return;
}
this.killindicator.count = bound(0, ceil(killtime), 10);
//sprint(this, strcat("^1You'll be dead in ", ftos(this.killindicator.cnt), " seconds\n"));
- for(e = world; (e = find(e, classname, "body")) != world; )
+ for(e = NULL; (e = find(e, classname, "body")) != NULL; )
{
if(e.enemy != this)
continue;
if (autocvar_sv_eventlog)
GameLogEcho(strcat(":part:", ftos(this.playerid)));
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_QUIT_DISCONNECT, this.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_DISCONNECT, this.netname);
MUTATOR_CALLHOOK(ClientDisconnect, this);
this.nextthink = time;
if ((this.owner.alpha < 0) || this.owner.chatbubbleentity != this)
{
- if(this.owner) // but why can that ever be world?
- this.owner.chatbubbleentity = world;
+ if(this.owner) // but why can that ever be NULL?
+ this.owner.chatbubbleentity = NULL;
remove(this);
return;
}
if (time > this.strength_finished)
{
this.items = this.items - (this.items & ITEM_Strength.m_itemid);
- //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERDOWN_STRENGTH, this.netname);
+ //Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERDOWN_STRENGTH, this.netname);
Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_POWERDOWN_STRENGTH);
}
}
if (time < this.strength_finished)
{
this.items = this.items | ITEM_Strength.m_itemid;
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_STRENGTH, this.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERUP_STRENGTH, this.netname);
Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_POWERUP_STRENGTH);
}
}
if (time > this.invincible_finished)
{
this.items = this.items - (this.items & ITEM_Shield.m_itemid);
- //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERDOWN_SHIELD, this.netname);
+ //Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERDOWN_SHIELD, this.netname);
Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_POWERDOWN_SHIELD);
}
}
if (time < this.invincible_finished)
{
this.items = this.items | ITEM_Shield.m_itemid;
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_POWERUP_SHIELD, this.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_POWERUP_SHIELD, this.netname);
Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_POWERUP_SHIELD);
}
}
{
this.superweapons_finished = 0;
this.items = this.items - (this.items & IT_SUPERWEAPON);
- //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_SUPERWEAPON_LOST, this.netname);
+ //Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_SUPERWEAPON_LOST, this.netname);
Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_SUPERWEAPON_LOST);
}
else if (this.items & IT_UNLIMITED_SUPERWEAPONS)
{
this.items = this.items - (this.items & IT_SUPERWEAPON);
this.weapons &= ~WEPSET_SUPERWEAPONS;
- //Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_SUPERWEAPON_BROKEN, this.netname);
+ //Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_SUPERWEAPON_BROKEN, this.netname);
Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_SUPERWEAPON_BROKEN);
}
}
if (time < this.superweapons_finished || (this.items & IT_UNLIMITED_SUPERWEAPONS))
{
this.items = this.items | IT_SUPERWEAPON;
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_SUPERWEAPON_PICKUP, this.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_SUPERWEAPON_PICKUP, this.netname);
Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_SUPERWEAPON_PICKUP);
}
else
WITHSELF(this, PutClientInServer());
- if(IS_PLAYER(this)) { Send_Notification(NOTIF_ALL, world, MSG_INFO, ((teamplay && this.team != -1) ? APP_TEAM_ENT(this, INFO_JOIN_PLAY_TEAM) : INFO_JOIN_PLAY), this.netname); }
+ if(IS_PLAYER(this)) { Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((teamplay && this.team != -1) ? APP_TEAM_ENT(this, INFO_JOIN_PLAY_TEAM) : INFO_JOIN_PLAY), this.netname); }
}
else
stuffcmd(this, "menu_showteamselect\n");
if(!IS_DEAD(this))
if(!gameover)
{
- entity head, closest_target = world;
+ entity head, closest_target = NULL;
head = WarpZone_FindRadius(this.origin, autocvar_g_vehicles_enter_radius, true);
while(head) // find the closest acceptable target to enter
if(!IS_DEAD(this))
{
entity veh;
- for(veh = world; (veh = findflags(veh, vehicle_flags, VHF_ISVEHICLE)); )
+ for(veh = NULL; (veh = findflags(veh, vehicle_flags, VHF_ISVEHICLE)); )
if(vdist(veh.origin - this.origin, <, autocvar_g_vehicles_enter_radius))
if(!IS_DEAD(veh))
if(veh.takedamage != DAMAGE_NO)
{ // drown!
if (this.pain_finished < time)
{
- Damage (this, world, world, autocvar_g_balance_contents_playerdamage_drowning * autocvar_g_balance_contents_damagerate, DEATH_DROWN.m_id, this.origin, '0 0 0');
+ Damage (this, NULL, NULL, autocvar_g_balance_contents_playerdamage_drowning * autocvar_g_balance_contents_damagerate, DEATH_DROWN.m_id, this.origin, '0 0 0');
this.pain_finished = time + 0.5;
}
}
Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_DISCONNECT_IDLING, timeleft);
}
if (timeleft <= 0) {
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_QUIT_KICK_IDLING, this.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_KICK_IDLING, this.netname);
dropclient(this);
return;
}
for (entity e = findchain(classname, "info_player_deathmatch"); e; e = e.chain)
{
vector org = e.origin;
- tracebox(e.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), e.origin - '0 0 512', MOVE_NOMONSTERS, world);
+ tracebox(e.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), e.origin - '0 0 512', MOVE_NOMONSTERS, NULL);
setorigin(e, trace_endpos);
if (navigation_findnearestwaypoint(e, false))
{
if(this.killindicator)
{
remove(this.killindicator);
- this.killindicator = world;
+ this.killindicator = NULL;
if(this.killindicator_teamchange)
defer_ClientKill_Now_TeamChange = true;
TRANSMUTE(Player, caller);
PlayerScore_Clear(caller);
Kill_Notification(NOTIF_ONE_ONLY, caller, MSG_CENTER, CPID_PREVENT_JOIN);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, ((teamplay && caller.team != -1) ? APP_TEAM_ENT(caller, INFO_JOIN_PLAY_TEAM) : INFO_JOIN_PLAY), caller.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((teamplay && caller.team != -1) ? APP_TEAM_ENT(caller, INFO_JOIN_PLAY_TEAM) : INFO_JOIN_PLAY), caller.netname);
WITHSELF(caller, PutClientInServer());
}
else
{
case CMD_REQUEST_COMMAND:
{
- if (argc >= 2) Say(caller, false, world, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1);
+ if (argc >= 2) Say(caller, false, NULL, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1);
return; // never fall through to usage
}
{
case CMD_REQUEST_COMMAND:
{
- if (argc >= 2) Say(caller, true, world, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1);
+ if (argc >= 2) Say(caller, true, NULL, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), 1);
return; // never fall through to usage
}
}
else if (argv(1) == "#0")
{
- trigger_magicear_processmessage_forallears(caller, -1, world, substring(command, argv_start_index(next_token), argv_end_index(-1) - argv_start_index(next_token)));
+ trigger_magicear_processmessage_forallears(caller, -1, NULL, substring(command, argv_start_index(next_token), argv_end_index(-1) - argv_start_index(next_token)));
return;
}
else { print_to(caller, strcat("tell: ", GetClientErrorString(tell_accepted, argv(1)), ".")); return; }
next_token = -1;
index = start_index;
- selection = world;
+ selection = NULL;
if (argc > start_index)
{
}
else
{
- selection = world;
+ selection = NULL;
FOREACH_CLIENT(true, LAMBDA(
if(strdecolorize(it.netname) == strdecolorize(input))
{
{
if (timeout_time > 0) // countdown is still going
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_TIMEOUT_ENDING, timeout_time);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_TIMEOUT_ENDING, timeout_time);
if (timeout_time == autocvar_sv_timeout_resumetime) // play a warning sound when only <sv_timeout_resumetime> seconds are left
- Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_PREPARE);
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_PREPARE);
this.nextthink = time + TIMEOUT_SLOWMO_VALUE; // think again in one second
timeout_time -= 1; // decrease the time counter
{
if (timeout_leadtime > 0) // countdown is still going
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_TIMEOUT_BEGINNING, timeout_leadtime);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_TIMEOUT_BEGINNING, timeout_leadtime);
this.nextthink = time + 1; // think again in one second
timeout_leadtime -= 1; // decrease the time counter
if (mon.realowner != caller && autocvar_g_monsters_edit < 2) { print_to(caller, "This monster does not belong to you"); return; }
if (!is_visible) { print_to(caller, "You must look at your monster to edit it"); return; }
- Damage(mon, world, world, mon.health + mon.max_health + 200, DEATH_KILL.m_id, mon.origin, '0 0 0');
+ Damage(mon, NULL, NULL, mon.health + mon.max_health + 200, DEATH_KILL.m_id, mon.origin, '0 0 0');
print_to(caller, strcat("Your pet '", mon.monster_name, "' has been brutally mutilated"));
return;
}
setthink(timeout_handler, timeout_handler_think);
timeout_handler.nextthink = time; // always let the entity think asap
- Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_TIMEOUT);
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_TIMEOUT);
}
}
else { print_to(caller, "^1Timeouts are not allowed to be called, enable them with sv_timeout 1.\n"); }
{
++m;
- tracebox(c, mi, ma, b, MOVE_WORLDONLY, world);
+ tracebox(c, mi, ma, b, MOVE_WORLDONLY, NULL);
++n;
if (!trace_startsolid)
c = trace_endpos;
}
- n += tracebox_inverted(c, mi, ma, b, MOVE_WORLDONLY, world, false, world);
+ n += tracebox_inverted(c, mi, ma, b, MOVE_WORLDONLY, NULL, false, NULL);
white += vlen(trace_endpos - c);
c = trace_endpos;
v2_x += random() * (ma.x - mi.x);
v2_y += random() * (ma.y - mi.y);
v2_z += random() * (ma.z - mi.z);
- traceline(v1, v2, MOVE_WORLDONLY, world);
+ traceline(v1, v2, MOVE_WORLDONLY, NULL);
if (trace_startsolid || trace_fraction < 1) ++r;
}
return r / q;
r = 0;
for (i = 0; i < q; ++i)
{
- tracebox(o + dz * i, mi, ma, o + dz * i, MOVE_WORLDONLY, world);
+ tracebox(o + dz * i, mi, ma, o + dz * i, MOVE_WORLDONLY, NULL);
if (trace_startsolid) ++r;
}
return r / q;
v.x = a.x + random() * b.x;
v.y = a.y + random() * b.y;
v.z = a.z + random() * b.z;
- traceline(v, v, MOVE_WORLDONLY, world);
+ traceline(v, v, MOVE_WORLDONLY, NULL);
if (trace_startsolid) ++c;
}
GotoNextMap(0);
}
remove(radarmapper);
- radarmapper = world;
+ radarmapper = NULL;
}
void RadarMap_Think(entity this)
{
{
LOG_INFO("Error writing ", this.netname, "\n");
remove(this);
- radarmapper = world;
+ radarmapper = NULL;
return;
}
LOG_INFO("Writing to ", this.netname, "...\n");
default:
i = argc;
remove(radarmapper);
- radarmapper = world;
+ radarmapper = NULL;
break;
}
}
'0 1 0' * world.absmax.y + '0 0 1' * world.absmax.z,
'1 0 0' * world.absmax.x,
MOVE_WORLDONLY,
- world);
+ NULL);
if (trace_startsolid) LOG_INFO(" ", ftos(world.absmin.x));
else LOG_INFO(" ", ftos(trace_endpos.x));
'1 0 0' * world.absmax.x + '0 0 1' * world.absmax.z,
'0 1 0' * world.absmax.y,
MOVE_WORLDONLY,
- world);
+ NULL);
if (trace_startsolid) LOG_INFO(" ", ftos(world.absmin.y));
else LOG_INFO(" ", ftos(trace_endpos.y));
'1 0 0' * world.absmax.x + '0 1 0' * world.absmax.y,
'0 0 1' * world.absmax.z,
MOVE_WORLDONLY,
- world);
+ NULL);
if (trace_startsolid) LOG_INFO(" ", ftos(world.absmin.z));
else LOG_INFO(" ", ftos(trace_endpos.z));
'0 1 0' * world.absmax.y + '0 0 1' * world.absmax.z,
'1 0 0' * world.absmin.x,
MOVE_WORLDONLY,
- world);
+ NULL);
if (trace_startsolid) LOG_INFO(" ", ftos(world.absmax.x));
else LOG_INFO(" ", ftos(trace_endpos.x));
'1 0 0' * world.absmax.x + '0 0 1' * world.absmax.z,
'0 1 0' * world.absmin.y,
MOVE_WORLDONLY,
- world);
+ NULL);
if (trace_startsolid) LOG_INFO(" ", ftos(world.absmax.y));
else LOG_INFO(" ", ftos(trace_endpos.y));
'1 0 0' * world.absmax.x + '0 1 0' * world.absmax.y,
'0 0 1' * world.absmin.z,
MOVE_WORLDONLY,
- world);
+ NULL);
if (trace_startsolid) LOG_INFO(" ", ftos(world.absmax.z));
else LOG_INFO(" ", ftos(trace_endpos.z));
{
// let's start at token 2 so we can skip sv_cmd bot_cmd
bot = find_bot_by_number(stof(argv(2)));
- if (bot == world) bot = find_bot_by_name(argv(2));
+ if (bot == NULL) bot = find_bot_by_name(argv(2));
if (bot) bot_queuecommand(bot, substring(s, argv_start_index(3), -1));
}
}
else if (argc >= 3) // this comes last
{
bot = find_bot_by_number(stof(argv(1)));
- if (bot == world) bot = find_bot_by_name(argv(1));
+ if (bot == NULL) bot = find_bot_by_name(argv(1));
if (bot)
{
LOG_INFO(strcat("Command '", substring(command, argv_start_index(2), -1), "' sent to bot ", bot.netname, "\n"));
string result2 = (argv(2) ? strcat("^7", argv(2)) : "^4TAILS");
string choice = ((random() > 0.5) ? result1 : result2);
- Send_Notification(NOTIF_ALL, world, MSG_MULTI, MULTI_COINTOSS, choice);
+ Send_Notification(NOTIF_ALL, NULL, MSG_MULTI, MULTI_COINTOSS, choice);
return;
}
if (argv(1) == "w")
{
.entity weaponentity = weaponentities[0];
- _setmodel(tmp_entity, (nextent(world)).(weaponentity).model);
+ _setmodel(tmp_entity, (nextent(NULL)).(weaponentity).model);
}
else
{
if (argv(1) == "w")
{
.entity weaponentity = weaponentities[0];
- _setmodel(tmp_entity, (nextent(world)).(weaponentity).model);
+ _setmodel(tmp_entity, (nextent(NULL)).(weaponentity).model);
}
else
{
start = stov(vtos(start));
end = stov(vtos(end));
- tracebox(start, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), end, MOVE_NOMONSTERS, world);
+ tracebox(start, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), end, MOVE_NOMONSTERS, NULL);
if (!trace_startsolid && trace_fraction < 1)
{
p = trace_endpos;
- tracebox(p, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), p, MOVE_NOMONSTERS, world);
+ tracebox(p, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), p, MOVE_NOMONSTERS, NULL);
if (trace_startsolid)
{
rint(42); // do an engine breakpoint on VM_rint so you can get the trace that errnoeously returns startsolid
- tracebox(start, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), end, MOVE_NOMONSTERS, world);
+ tracebox(start, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), end, MOVE_NOMONSTERS, NULL);
// how much do we need to back off?
safe = 1;
for ( ; ; )
{
pos = p * (1 - (safe + unsafe) * 0.5) + start * ((safe + unsafe) * 0.5);
- tracebox(pos, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), pos, MOVE_NOMONSTERS, world);
+ tracebox(pos, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), pos, MOVE_NOMONSTERS, NULL);
if (trace_startsolid)
{
if ((safe + unsafe) * 0.5 == unsafe) break;
LOG_INFO("safe distance to back off: ", ftos(safe * vlen(p - start)), "qu\n");
LOG_INFO("unsafe distance to back off: ", ftos(unsafe * vlen(p - start)), "qu\n");
- tracebox(p, STAT(PL_MIN, NULL) + '0.1 0.1 0.1', STAT(PL_MAX, NULL) - '0.1 0.1 0.1', p, MOVE_NOMONSTERS, world);
+ tracebox(p, STAT(PL_MIN, NULL) + '0.1 0.1 0.1', STAT(PL_MAX, NULL) - '0.1 0.1 0.1', p, MOVE_NOMONSTERS, NULL);
if (trace_startsolid) LOG_INFO("trace_endpos much in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
else LOG_INFO("trace_endpos just in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
if (++hitcount >= 10) break;
{
q = p + normalize(end - p) * (dq + dqf);
if (q == q0) break;
- tracebox(p, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), q, MOVE_NOMONSTERS, world);
+ tracebox(p, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), q, MOVE_NOMONSTERS, NULL);
if (trace_startsolid) error("THIS ONE cannot happen");
if (trace_fraction > 0) dq += dqf * trace_fraction;
dqf *= 0.5;
case "debug2":
{
- e = nextent(world);
+ e = nextent(NULL);
tracebox(e.origin + '0 0 32', e.mins, e.maxs, e.origin + '0 0 -1024', MOVE_NORMAL, e);
vv = trace_endpos;
if (trace_fraction == 1)
{
if (argc == 4)
{
- e = nextent(world);
+ e = nextent(NULL);
if (tracewalk(e, stov(argv(2)), e.mins, e.maxs, stov(argv(3)), MOVE_NORMAL)) LOG_INFO("can walk\n");
else LOG_INFO("cannot walk\n");
return;
{
vv = stov(argv(2));
dv = stov(argv(3));
- traceline(vv, dv, MOVE_NORMAL, world);
- __trailparticles(world, particleeffectnum(EFFECT_TR_NEXUIZPLASMA), vv, trace_endpos);
- __trailparticles(world, particleeffectnum(EFFECT_TR_CRYLINKPLASMA), trace_endpos, dv);
+ traceline(vv, dv, MOVE_NORMAL, NULL);
+ __trailparticles(NULL, particleeffectnum(EFFECT_TR_NEXUIZPLASMA), vv, trace_endpos);
+ __trailparticles(NULL, particleeffectnum(EFFECT_TR_CRYLINKPLASMA), trace_endpos, dv);
return;
}
}
BanCommand_macro_help();
LOG_INFO("\nCommon networked commands:\n");
- CommonCommand_macro_help(world);
+ CommonCommand_macro_help(NULL);
LOG_INFO("\nGeneric commands shared by all programs:\n");
GenericCommand_macro_help();
{
return;
}
- else if (CommonCommand_macro_usage(argc, world)) // same here, but for common commands instead
+ else if (CommonCommand_macro_usage(argc, NULL)) // same here, but for common commands instead
{
return;
}
{
return; // handled by server/command/ipban.qc
}
- else if (CommonCommand_macro_command(argc, world, command))
+ else if (CommonCommand_macro_command(argc, NULL, command))
{
return; // handled by server/command/common.qc
}
}
vote_called = VOTE_NULL;
- vote_caller = world;
+ vote_caller = NULL;
vote_caller_name = string_null;
vote_endtime = 0;
if (vote_caller) vote_caller.vote_waittime = 0; // people like your votes, you don't need to wait to vote again
VoteReset();
- Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_VOTE_ACCEPT);
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_VOTE_ACCEPT);
}
void VoteReject()
{
bprint("\{1}^2* ^3", OriginalCallerName(), "^2's vote for ", vote_called_display, "^2 was rejected\n");
VoteReset();
- Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_VOTE_FAIL);
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_VOTE_FAIL);
}
void VoteTimeout()
{
bprint("\{1}^2* ^3", OriginalCallerName(), "^2's vote for ", vote_called_display, "^2 timed out\n");
VoteReset();
- Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_VOTE_FAIL);
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_VOTE_FAIL);
}
void VoteSpam(float notvoters, float mincount, string result)
}
FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(++tmp_playercount));
- if (tmp_playercount > 1) Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_VOTE_CALL); // don't announce a "vote now" sound if player is alone
+ if (tmp_playercount > 1) Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_VOTE_CALL); // don't announce a "vote now" sound if player is alone
bprint("\{1}^2* ^3", OriginalCallerName(), "^2 calls a vote for ", vote_called_display, "\n");
if (autocvar_sv_eventlog) GameLogEcho(strcat(":vote:vcall:", ftos(vote_caller.playerid), ":", vote_called_display));
s = strcat(s, "S");
if(time < player.invincible_finished)
s = strcat(s, "I");
- if(player.flagcarried != world)
+ if(player.flagcarried != NULL)
s = strcat(s, "F");
if(PHYS_INPUT_BUTTON_CHAT(player))
s = strcat(s, "T");
Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_TEAMKILL_FRAG, targ.netname);
Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_TEAMKILL_FRAGGED, attacker.netname);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(targ.team, INFO_DEATH_TEAMKILL), targ.netname, attacker.netname, deathlocation, targ.killcount);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(targ.team, INFO_DEATH_TEAMKILL), targ.netname, attacker.netname, deathlocation, targ.killcount);
// In this case, the death message will ALWAYS be "foo was betrayed by bar"
// No need for specific death/weapon messages...
// add waypoint
if(show_waypoint)
- WaypointSprite_Spawn(WP_Frozen, 0, 0, targ, '0 0 64', world, targ.team, targ, waypointsprite_attached, true, RADARICON_WAYPOINT);
+ WaypointSprite_Spawn(WP_Frozen, 0, 0, targ, '0 0 64', NULL, targ.team, targ, waypointsprite_attached, true, RADARICON_WAYPOINT);
}
void Unfreeze (entity targ)
// remove the ice block
if(targ.iceblock)
remove(targ.iceblock);
- targ.iceblock = world;
+ targ.iceblock = NULL;
}
void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
Unfreeze(targ);
targ.health = autocvar_g_frozen_revive_falldamage_health;
Send_Effect(EFFECT_ICEORGLASS, targ.origin, '0 0 0', 3);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED_FALL, targ.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED_FALL, targ.netname);
Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_FREEZETAG_REVIVE_SELF);
}
Fire_ApplyEffect(this.owner);
if(!Fire_IsBurning(this.owner))
{
- this.owner.fire_burner = world;
+ this.owner.fire_burner = NULL;
remove(this);
return;
}
void RemoveGrapplingHook(entity pl)
{
- if(pl.hook == world)
+ if(pl.hook == NULL)
return;
remove(pl.hook);
- pl.hook = world;
+ pl.hook = NULL;
if(pl.movetype == MOVETYPE_FLY)
pl.movetype = MOVETYPE_WALK;
if (!this.target)
objerror (this, "dynlight: no target to follow");
- targ = find(world, targetname, this.target);
+ targ = find(NULL, targetname, this.target);
this.movetype = MOVETYPE_FOLLOW;
this.aiment = targ;
this.owner = targ;
if (!this.target)
objerror (this, "dynlight: no target to follow");
- targ = find(world, targetname, this.target);
+ targ = find(NULL, targetname, this.target);
this.target = targ.target;
setorigin(this, targ.origin);
setthink(this, train_next);
if (!this.target)
objerror (this, "dynlight: no target to follow");
- targ = find(world, targetname, this.target);
+ targ = find(NULL, targetname, this.target);
setattachment(this, targ, this.dtagname);
this.owner = targ;
setthink(this, dynlight_think);
c = 0;
while (c < 6)
{
- traceline (org, org + vec, true, world);
+ traceline (org, org + vec, true, NULL);
vec = vec * -1;
if (trace_fraction < 1)
{
loc = trace_endpos;
- traceline (loc, loc + vec, true, world);
+ traceline (loc, loc + vec, true, NULL);
if (trace_fraction >= 1)
org = loc + vec;
}
if(this.lodtarget1 != "")
{
- e = find(world, targetname, this.lodtarget1);
+ e = find(NULL, targetname, this.lodtarget1);
if(e)
{
this.lodmodel1 = e.model;
}
if(this.lodtarget2 != "")
{
- e = find(world, targetname, this.lodtarget2);
+ e = find(NULL, targetname, this.lodtarget2);
if(e)
{
this.lodmodel2 = e.model;
o.y += random() * (world.maxs.y - world.mins.y);
o.z += random() * (world.maxs.z - world.mins.z);
- tracebox(o, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), o - '0 0 32768', MOVE_WORLDONLY, world);
+ tracebox(o, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), o - '0 0 32768', MOVE_WORLDONLY, NULL);
if(trace_fraction == 1)
continue;
for(i = 0; i < 64; i += 4)
{
- tracebox(o, '-1 -1 -1' * i, '1 1 1' * i, o - '0 0 32768', MOVE_WORLDONLY, world);
+ tracebox(o, '-1 -1 -1' * i, '1 1 1' * i, o - '0 0 32768', MOVE_WORLDONLY, NULL);
if(trace_fraction == 1)
continue;
LOG_INFO(ftos(i), " -> ", vtos(trace_endpos), "\n");
compressShortVector_init();
maxclients = 0;
- for (entity head = nextent(world); head; head = nextent(head))
+ for (entity head = nextent(NULL); head; head = nextent(head))
{
++maxclients;
}
local float cyc;
// look for info_intermission first
- spot = find (world, classname, "info_intermission");
+ spot = find (NULL, classname, "info_intermission");
if (spot)
{ // pick a random one
cyc = random() * 4;
}
// then look for the start position
- spot = find (world, classname, "info_player_start");
+ spot = find (NULL, classname, "info_player_start");
if (spot)
return spot;
// testinfo_player_start is only found in regioned levels
- spot = find (world, classname, "testplayerstart");
+ spot = find (NULL, classname, "testplayerstart");
if (spot)
return spot;
// then look for the start position
- spot = find (world, classname, "info_player_deathmatch");
+ spot = find (NULL, classname, "info_player_deathmatch");
if (spot)
return spot;
//objerror ("FindIntermission: no spot");
- return world;
+ return NULL;
}
*/
fputs(file, strcat(s, "\n"));
}
- s = strcat(":labels:player:", GetPlayerScoreString(world, 0));
+ s = strcat(":labels:player:", GetPlayerScoreString(NULL, 0));
if(to_console)
LOG_INFO(s, "\n");
if(to_eventlog)
PlayerStats_GameReport(true);
WeaponStats_Shutdown();
- Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_Null); // kill all centerprints now
+ Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_Null); // kill all centerprints now
if(autocvar_sv_eventlog)
GameLogEcho(":gameover");
tl += autocvar_timelimit_overtime;
cvar_set("timelimit", ftos(tl));
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_OVERTIME_TIME, autocvar_timelimit_overtime * 60);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_OVERTIME_TIME, autocvar_timelimit_overtime * 60);
}
float GetWinningCode(float fraglimitreached, float equality)
if (limit)
if (leaderfrags == limit - 1)
- Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_REMAINING_FRAG_1);
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_1);
else if (leaderfrags == limit - 2)
- Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_REMAINING_FRAG_2);
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_2);
else if (leaderfrags == limit - 3)
- Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_REMAINING_FRAG_3);
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_REMAINING_FRAG_3);
}
}
t = NUM_TEAM_3;
else // if(team4_score)
t = NUM_TEAM_4;
- CheckAllowedTeams(world);
+ CheckAllowedTeams(NULL);
for(i = 0; i < MAX_TEAMSCORE; ++i)
{
if(t != NUM_TEAM_1) if(c1 >= 0) TeamScore_AddToTeam(NUM_TEAM_1, i, -1000);
{
checkrules_suddendeathwarning = true;
if(g_race && !g_race_qualifying)
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_RACE_FINISHLAP);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_RACE_FINISHLAP);
else
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_OVERTIME_FRAG);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_OVERTIME_FRAG);
}
}
else
for(i = 0; i < mapvote_count_real; ++i)
if ( mapvote_maps_flags[i] & GTV_AVAILABLE )
{
- RandomSelection_Add(world, i, string_null, 1, mapvote_selections[i]);
+ RandomSelection_Add(NULL, i, string_null, 1, mapvote_selections[i]);
if ( gametypevote && mapvote_maps[i] == MapInfo_Type_ToString(MapInfo_CurrentGametype()) )
{
currentVotes = mapvote_selections[i];
for(i = 0; i < mapvote_count_real; ++i)
if(i != firstPlace)
if ( mapvote_maps_flags[i] & GTV_AVAILABLE )
- RandomSelection_Add(world, i, string_null, 1, mapvote_selections[i]);
+ RandomSelection_Add(NULL, i, string_null, 1, mapvote_selections[i]);
secondPlace = RandomSelection_chosen_float;
secondPlaceVotes = RandomSelection_best_priority;
//dprint("Second place: ", ftos(secondPlace), "\n");
float num_nearest;
num_nearest = 0;
- localhead = find(world, field, value);
+ localhead = find(NULL, field, value);
while (localhead)
{
if ((localhead.items == IT_KEY1 || localhead.items == IT_KEY2) && localhead.target == "###item###")
// now use the first one from our list that we can see
for (i = 0; i < num_nearest; ++i)
{
- traceline(point, nearest_entity[i].origin, true, world);
+ traceline(point, nearest_entity[i].origin, true, NULL);
if (trace_fraction == 1)
{
if (i != 0)
}
if (num_nearest == 0)
- return world;
+ return NULL;
LOG_TRACE("Not seeing any location point, using nearest as fallback.\n");
/* DEBUGGING CODE:
{
if (e.initialize_entity)
{
- entity ent, prev = world;
+ entity ent, prev = NULL;
for (ent = initialize_entity_first; ent; )
{
if ((ent == e) || ((ent.classname == "initialize_entity") && (ent.enemy == e)))
e.initialize_entity_order = order;
cur = initialize_entity_first;
- prev = world;
+ prev = NULL;
for (;;)
{
if (!cur || cur.initialize_entity_order > order)
}
if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
return true;
- if (toucher == world && this.size != '0 0 0')
+ if (toucher == NULL && this.size != '0 0 0')
{
vector tic;
tic = this.velocity * sys_frametime;
continue;
// rule 4: we must "see" some spawnpoint or item
- for(sp = world; (sp = find(sp, classname, "info_player_deathmatch")); )
+ for(sp = NULL; (sp = find(sp, classname, "info_player_deathmatch")); )
if(checkpvs(mstart, sp))
if((traceline(mstart, sp.origin, MOVE_NORMAL, e), trace_fraction) >= 1)
break;
if(!sp)
{
- for(sp = world; (sp = findflags(sp, flags, FL_ITEM)); )
+ for(sp = NULL; (sp = findflags(sp, flags, FL_ITEM)); )
if(checkpvs(mstart, sp))
if((traceline(mstart, sp.origin + (sp.mins + sp.maxs) * 0.5, MOVE_NORMAL, e), trace_fraction) >= 1)
break;
else
e.angles = AnglesTransform_ToAngles(e.angles);
setorigin(e, org);
- setattachment(e, world, "");
+ setattachment(e, NULL, "");
setorigin(e, e.origin);
}
{
ent.movetype = MOVETYPE_FLY;
PROJECTILE_MAKETRIGGER(ent);
- ent.aiment = world;
+ ent.aiment = NULL;
}
float LostMovetypeFollow(entity ent)
{
/** called when a player spawns as player, after shared setup, before his weapon is chosen (so items may be changed in here) */
#define EV_PlayerSpawn(i, o) \
/** player spawning */ i(entity, MUTATOR_ARGV_0_entity) \
- /** spot that was used, or world */ i(entity, MUTATOR_ARGV_1_entity) \
+ /** spot that was used, or NULL */ i(entity, MUTATOR_ARGV_1_entity) \
/**/
MUTATOR_HOOKABLE(PlayerSpawn, EV_PlayerSpawn);
//print("^2Activated objective ", this.targetname, "=", etos(this), "\n");
//print("Activator is ", actor.classname, "\n");
- for (entity e = world; (e = find(e, target, this.targetname)); )
+ for (entity e = NULL; (e = find(e, target, this.targetname)); )
{
if (e.classname == "target_objective_decrease")
{
{
WaypointSprite_Disown(trigger.assault_sprite, waypointsprite_deadlifetime);
if(trigger.classname == "func_assault_destructible")
- trigger.sprite = world; // TODO: just unsetting it?!
+ trigger.sprite = NULL; // TODO: just unsetting it?!
}
else
return; // already activated! cannot activate again!
void assault_setenemytoobjective(entity this)
{
entity objective;
- for(objective = world; (objective = find(objective, targetname, this.target)); )
+ for(objective = NULL; (objective = find(objective, targetname, this.target)); )
{
if(objective.classname == "target_objective")
{
- if(this.enemy == world)
+ if(this.enemy == NULL)
this.enemy = objective;
else
objerror(this, "more than one objective as target - fix the map!");
}
}
- if(this.enemy == world)
+ if(this.enemy == NULL)
objerror(this, "no objective as target - fix the map!");
}
void target_objective_decrease_activate(entity this)
{
entity ent, spr;
- this.owner = world;
- for(ent = world; (ent = find(ent, target, this.targetname)); )
+ this.owner = NULL;
+ for(ent = NULL; (ent = find(ent, target, this.targetname)); )
{
- if(ent.assault_sprite != world)
+ if(ent.assault_sprite != NULL)
{
WaypointSprite_Disown(ent.assault_sprite, waypointsprite_deadlifetime);
if(ent.classname == "func_assault_destructible")
- ent.sprite = world; // TODO: just unsetting it?!
+ ent.sprite = NULL; // TODO: just unsetting it?!
}
spr = WaypointSprite_SpawnFixed(WP_Assault, 0.5 * (ent.absmin + ent.absmax), ent, assault_sprite, RADARICON_OBJECTIVE);
}
entity ent;
- ent = find(world, classname, "target_assault_roundend");
+ ent = find(NULL, classname, "target_assault_roundend");
if(ent)
{
if(ent.winning) // round end has been triggered by attacking team
this.use = assault_objective_decrease_use;
this.health = ASSAULT_VALUE_INACTIVE;
this.max_health = ASSAULT_VALUE_INACTIVE;
- this.enemy = world;
+ this.enemy = NULL;
InitializeEntity(this, target_objective_decrease_findtarget, INITPRIO_FINDTARGET);
}
continue;
found = false;
- for(tod = world; (tod = find(tod, targetname, ad.target)); )
+ for(tod = NULL; (tod = find(tod, targetname, ad.target)); )
{
if(tod.classname == "target_objective_decrease")
{
p = 0.5 * (ad.absmin + ad.absmax);
// dprint(vtos(ad.origin), " ", vtos(ad.absmin), " ", vtos(ad.absmax),"\n");
// te_knightspike(p);
- // te_lightning2(world, '0 0 0', p);
+ // te_lightning2(NULL, '0 0 0', p);
// Find and rate waypoints around it
found = false;
- best = world;
+ best = NULL;
bestvalue = 99999999999;
for(radius=0; radius<1500 && !found; radius+=500)
{
if(best)
{
/// dprint("waypoints around target were found\n");
- // te_lightning2(world, '0 0 0', best.origin);
+ // te_lightning2(NULL, '0 0 0', best.origin);
// te_knightspike(best.origin);
navigation_routerating(this, best, ratingscale, 4000);
{
if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0)
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER);
allowed_to_spawn = false;
round_handler_Init(5, autocvar_g_ca_warmup, autocvar_g_ca_round_timelimit);
FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(nades_Clear(it)));
int winner_team = CA_GetWinnerTeam();
if(winner_team > 0)
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
- Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
TeamScore_AddToTeam(winner_team, ST_CA_ROUNDS, +1);
}
else if(winner_team == -1)
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_TIED);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_TIED);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_TIED);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_TIED);
}
allowed_to_spawn = false;
if(CA_ALIVE_TEAMS_OK())
{
if(prev_missing_teams_mask > 0)
- Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_MISSING_TEAMS);
+ Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS);
prev_missing_teams_mask = -1;
return true;
}
if(total_players == 0)
{
if(prev_missing_teams_mask > 0)
- Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_MISSING_TEAMS);
+ Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS);
prev_missing_teams_mask = -1;
return false;
}
if(ca_teams >= 4) missing_teams_mask += (!pinkalive) * 8;
if(prev_missing_teams_mask != missing_teams_mask)
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_MISSING_TEAMS, missing_teams_mask);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_MISSING_TEAMS, missing_teams_mask);
prev_missing_teams_mask = missing_teams_mask;
}
return false;
void ctf_EventLog(string mode, int flagteam, entity actor) // use an alias for easy changing and quick editing later
{
if(autocvar_sv_eventlog)
- GameLogEcho(sprintf(":ctf:%s:%d:%d:%s", mode, flagteam, actor.team, ((actor != world) ? ftos(actor.playerid) : "")));
- //GameLogEcho(strcat(":ctf:", mode, ":", ftos(flagteam), ((actor != world) ? (strcat(":", ftos(actor.playerid))) : "")));
+ GameLogEcho(sprintf(":ctf:%s:%d:%d:%s", mode, flagteam, actor.team, ((actor != NULL) ? ftos(actor.playerid) : "")));
+ //GameLogEcho(strcat(":ctf:", mode, ":", ftos(flagteam), ((actor != NULL) ? (strcat(":", ftos(actor.playerid))) : "")));
}
void ctf_CaptureRecord(entity flag, entity player)
string refername = db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"));
// notify about shit
- if(ctf_oneflag) { Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_CTF_CAPTURE_NEUTRAL, player.netname); }
- else if(!ctf_captimerecord) { Send_Notification(NOTIF_ALL, world, MSG_CHOICE, APP_TEAM_ENT(flag, CHOICE_CTF_CAPTURE_TIME), player.netname, (cap_time * 100)); }
- else if(cap_time < cap_record) { Send_Notification(NOTIF_ALL, world, MSG_CHOICE, APP_TEAM_ENT(flag, CHOICE_CTF_CAPTURE_BROKEN), player.netname, refername, (cap_time * 100), (cap_record * 100)); }
- else { Send_Notification(NOTIF_ALL, world, MSG_CHOICE, APP_TEAM_ENT(flag, CHOICE_CTF_CAPTURE_UNBROKEN), player.netname, refername, (cap_time * 100), (cap_record * 100)); }
+ if(ctf_oneflag) { Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_CTF_CAPTURE_NEUTRAL, player.netname); }
+ else if(!ctf_captimerecord) { Send_Notification(NOTIF_ALL, NULL, MSG_CHOICE, APP_TEAM_ENT(flag, CHOICE_CTF_CAPTURE_TIME), player.netname, (cap_time * 100)); }
+ else if(cap_time < cap_record) { Send_Notification(NOTIF_ALL, NULL, MSG_CHOICE, APP_TEAM_ENT(flag, CHOICE_CTF_CAPTURE_BROKEN), player.netname, refername, (cap_time * 100), (cap_record * 100)); }
+ else { Send_Notification(NOTIF_ALL, NULL, MSG_CHOICE, APP_TEAM_ENT(flag, CHOICE_CTF_CAPTURE_UNBROKEN), player.netname, refername, (cap_time * 100), (cap_record * 100)); }
// write that shit in the database
if(!ctf_oneflag) // but not in 1-flag mode
void ctf_FlagcarrierWaypoints(entity player)
{
- WaypointSprite_Spawn(WP_FlagCarrier, 0, 0, player, FLAG_WAYPOINT_OFFSET, world, player.team, player, wps_flagcarrier, true, RADARICON_FLAG);
+ WaypointSprite_Spawn(WP_FlagCarrier, 0, 0, player, FLAG_WAYPOINT_OFFSET, NULL, player.team, player, wps_flagcarrier, true, RADARICON_FLAG);
WaypointSprite_UpdateMaxHealth(player.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(start_health, start_armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id) * 2);
WaypointSprite_UpdateHealth(player.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(player.health, player.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id));
WaypointSprite_UpdateTeamRadar(player.wps_flagcarrier, RADARICON_FLAGCARRIER, WPCOLOR_FLAGCARRIER(player.team));
flag.ctf_status = FLAG_DROPPED;
// messages and sounds
- Send_Notification(NOTIF_ALL, world, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_LOST) : INFO_CTF_LOST_NEUTRAL), player.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_LOST) : INFO_CTF_LOST_NEUTRAL), player.netname);
_sound(flag, CH_TRIGGER, flag.snd_flag_dropped, VOL_BASE, ATTEN_NONE);
ctf_EventLog("dropped", player.team, player);
// waypoints
if(autocvar_g_ctf_flag_dropped_waypoint) {
- entity wp = WaypointSprite_Spawn(WP_FlagDropped, 0, 0, flag, FLAG_WAYPOINT_OFFSET, world, ((autocvar_g_ctf_flag_dropped_waypoint == 2) ? 0 : player.team), flag, wps_flagdropped, true, RADARICON_FLAG);
+ entity wp = WaypointSprite_Spawn(WP_FlagDropped, 0, 0, flag, FLAG_WAYPOINT_OFFSET, NULL, ((autocvar_g_ctf_flag_dropped_waypoint == 2) ? 0 : player.team), flag, wps_flagdropped, true, RADARICON_FLAG);
wp.colormod = WPCOLOR_DROPPEDFLAG(flag.team);
}
if(droptype == DROP_PASS)
{
flag.pass_distance = 0;
- flag.pass_sender = world;
- flag.pass_target = world;
+ flag.pass_sender = NULL;
+ flag.pass_target = NULL;
}
}
player.throw_antispam = sender.throw_antispam;
flag.pass_distance = 0;
- flag.pass_sender = world;
- flag.pass_target = world;
+ flag.pass_sender = NULL;
+ flag.pass_target = NULL;
}
void ctf_Handle_Throw(entity player, entity receiver, int droptype)
if(flag.speedrunning) { ctf_RespawnFlag(flag); return; }
// reset the flag
- setattachment(flag, world, "");
+ setattachment(flag, NULL, "");
setorigin(flag, player.origin + FLAG_DROP_OFFSET);
- flag.owner.flagcarried = world;
- flag.owner = world;
+ flag.owner.flagcarried = NULL;
+ flag.owner = NULL;
flag.solid = SOLID_TRIGGER;
flag.ctf_dropper = player;
flag.ctf_droptime = time;
// other
_sound(player, CH_TRIGGER, flag.snd_flag_touch, VOL_BASE, ATTEN_NORM);
- WarpZone_TrailParticles(world, _particleeffectnum(flag.passeffect), player.origin, targ_origin);
+ WarpZone_TrailParticles(NULL, _particleeffectnum(flag.passeffect), player.origin, targ_origin);
ctf_EventLog("pass", flag.team, player);
break;
}
{
entity enemy_flag = ((capturetype == CAPTURE_NORMAL) ? toucher.flagcarried : toucher);
entity player = ((capturetype == CAPTURE_NORMAL) ? toucher : enemy_flag.ctf_dropper);
- entity player_team_flag = world, tmp_entity;
+ entity player_team_flag = NULL, tmp_entity;
float old_time, new_time;
if(!player) { return; } // without someone to give the reward to, we can't possibly cap
// messages and sounds
if(IS_MONSTER(player))
{
- Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT(flag, INFO_CTF_RETURN_MONSTER), player.monster_name);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_ENT(flag, INFO_CTF_RETURN_MONSTER), player.monster_name);
}
else if(flag.team)
{
Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_ENT(flag, CENTER_CTF_RETURN));
- Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT(flag, INFO_CTF_RETURN), player.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_ENT(flag, INFO_CTF_RETURN), player.netname);
}
_sound(player, CH_TRIGGER, flag.snd_flag_returned, VOL_BASE, ATTEN_NONE);
ctf_EventLog("return", flag.team, player);
}
// messages and sounds
- Send_Notification(NOTIF_ALL, world, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_PICKUP) : INFO_CTF_PICKUP_NEUTRAL), player.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_PICKUP) : INFO_CTF_PICKUP_NEUTRAL), player.netname);
if(ctf_stalemate) { Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_STALEMATE_CARRIER); }
if(!flag.team) { Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_PICKUP_NEUTRAL); }
else if(CTF_DIFFTEAM(player, flag)) { Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_ENT(flag, CENTER_CTF_PICKUP)); }
{
switch(returntype)
{
- case RETURN_DROPPED: Send_Notification(NOTIF_ALL, world, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_DROPPED) : INFO_CTF_FLAGRETURN_DROPPED_NEUTRAL)); break;
- case RETURN_DAMAGE: Send_Notification(NOTIF_ALL, world, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_DAMAGED) : INFO_CTF_FLAGRETURN_DAMAGED_NEUTRAL)); break;
- case RETURN_SPEEDRUN: Send_Notification(NOTIF_ALL, world, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_SPEEDRUN) : INFO_CTF_FLAGRETURN_SPEEDRUN_NEUTRAL), ctf_captimerecord); break;
- case RETURN_NEEDKILL: Send_Notification(NOTIF_ALL, world, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_NEEDKILL) : INFO_CTF_FLAGRETURN_NEEDKILL_NEUTRAL)); break;
+ case RETURN_DROPPED: Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_DROPPED) : INFO_CTF_FLAGRETURN_DROPPED_NEUTRAL)); break;
+ case RETURN_DAMAGE: Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_DAMAGED) : INFO_CTF_FLAGRETURN_DAMAGED_NEUTRAL)); break;
+ case RETURN_SPEEDRUN: Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_SPEEDRUN) : INFO_CTF_FLAGRETURN_SPEEDRUN_NEUTRAL), ctf_captimerecord); break;
+ case RETURN_NEEDKILL: Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_NEEDKILL) : INFO_CTF_FLAGRETURN_NEEDKILL_NEUTRAL)); break;
default:
case RETURN_TIMEOUT:
- { Send_Notification(NOTIF_ALL, world, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_TIMEOUT) : INFO_CTF_FLAGRETURN_TIMEOUT_NEUTRAL)); break; }
+ { Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((flag.team) ? APP_TEAM_ENT(flag, INFO_CTF_FLAGRETURN_TIMEOUT) : INFO_CTF_FLAGRETURN_TIMEOUT_NEUTRAL)); break; }
}
_sound(flag, CH_TRIGGER, flag.snd_flag_respawn, VOL_BASE, ATTEN_NONE);
- ctf_EventLog("returned", flag.team, world);
+ ctf_EventLog("returned", flag.team, NULL);
ctf_RespawnFlag(flag);
}
}
int stale_flags = 0, stale_red_flags = 0, stale_blue_flags = 0, stale_yellow_flags = 0, stale_pink_flags = 0, stale_neutral_flags = 0;
entity tmp_entity;
- entity ctf_staleflaglist = world; // reset the list, we need to build the list each time this function runs
+ entity ctf_staleflaglist = NULL; // reset the list, we need to build the list each time this function runs
// build list of stale flags
for(tmp_entity = ctf_worldflaglist; tmp_entity; tmp_entity = tmp_entity.ctf_worldflagnext)
{
if((tmp_entity.owner) && (!tmp_entity.owner.wps_enemyflagcarrier))
{
- entity wp = WaypointSprite_Spawn(((ctf_oneflag) ? WP_FlagCarrier : WP_FlagCarrierEnemy), 0, 0, tmp_entity.owner, FLAG_WAYPOINT_OFFSET, world, 0, tmp_entity.owner, wps_enemyflagcarrier, true, RADARICON_FLAG);
+ entity wp = WaypointSprite_Spawn(((ctf_oneflag) ? WP_FlagCarrier : WP_FlagCarrierEnemy), 0, 0, tmp_entity.owner, FLAG_WAYPOINT_OFFSET, NULL, 0, tmp_entity.owner, wps_enemyflagcarrier, true, RADARICON_FLAG);
wp.colormod = WPCOLOR_ENEMYFC(tmp_entity.owner.team);
setcefc(tmp_entity.owner.wps_enemyflagcarrier, ctf_Stalemate_Customize);
}
if(CTF_SAMETEAM(this, this.owner) && this.team)
{
if(autocvar_g_ctf_flag_return) // drop the flag if reverse status has changed
- ctf_Handle_Throw(this.owner, world, DROP_THROW);
+ ctf_Handle_Throw(this.owner, NULL, DROP_THROW);
else if(vdist(this.owner.origin - this.ctf_spawnorigin, <=, autocvar_g_ctf_flag_return_carried_radius))
ctf_Handle_Return(this, this.owner);
}
targ_origin = WarpZone_RefSys_TransformOrigin(this.pass_target, this, targ_origin); // origin of target as seen by the flag (us)
WarpZone_TraceLine(this.origin, targ_origin, MOVE_NOMONSTERS, this);
- if((this.pass_target == world)
+ if((this.pass_target == NULL)
|| (IS_DEAD(this.pass_target))
|| (this.pass_target.flagcarried)
|| (vdist(this.origin - targ_origin, <, autocvar_g_ctf_pass_radius))
|| (time > this.ctf_droptime + autocvar_g_ctf_pass_timelimit))
{
// give up, pass failed
- ctf_Handle_Drop(this, world, DROP_PASS);
+ ctf_Handle_Drop(this, NULL, DROP_PASS);
}
else
{
WaypointSprite_Kill(flag.owner.wps_enemyflagcarrier);
WaypointSprite_Kill(flag.wps_flagcarrier);
- flag.owner.flagcarried = world;
+ flag.owner.flagcarried = NULL;
if(flag.speedrunning)
ctf_FakeTimeLimit(flag.owner, -1);
{ WaypointSprite_Kill(flag.wps_flagdropped); }
// reset the flag
- setattachment(flag, world, "");
+ setattachment(flag, NULL, "");
setorigin(flag, flag.ctf_spawnorigin);
flag.movetype = ((flag.noalign) ? MOVETYPE_NONE : MOVETYPE_TOSS);
flag.flags = FL_ITEM | FL_NOTARGET;
flag.ctf_status = FLAG_BASE;
- flag.owner = world;
+ flag.owner = NULL;
flag.pass_distance = 0;
- flag.pass_sender = world;
- flag.pass_target = world;
- flag.ctf_dropper = world;
+ flag.pass_sender = NULL;
+ flag.pass_target = NULL;
+ flag.ctf_dropper = NULL;
flag.ctf_pickuptime = 0;
flag.ctf_droptime = 0;
flag.ctf_flagdamaged = 0;
void ctf_Reset(entity this)
{
if(this.owner && IS_PLAYER(this.owner))
- ctf_Handle_Throw(this.owner, world, DROP_RESET);
+ ctf_Handle_Throw(this.owner, NULL, DROP_RESET);
ctf_RespawnFlag(this);
}
flag.ctf_worldflagnext = ctf_worldflaglist; // link flag into ctf_worldflaglist
ctf_worldflaglist = flag;
- setattachment(flag, world, "");
+ setattachment(flag, NULL, "");
flag.netname = strzone(sprintf("%s%s^7 flag", Team_ColorCode(teamnumber), Team_ColorName_Upper(teamnumber)));
flag.team = teamnumber;
return f;
f = f.ctf_worldflagnext;
}
- return world;
+ return NULL;
}
entity havocbot_ctf_find_enemy_flag(entity bot)
return f;
f = f.ctf_worldflagnext;
}
- return world;
+ return NULL;
}
int havocbot_ctf_teamcount(entity bot, vector org, float tc_radius)
{
// flag is out in the field
if(head.ctf_status != FLAG_BASE)
- if(head.tag_entity==world) // dropped
+ if(head.tag_entity==NULL) // dropped
{
if(df_radius)
{
return;
}
- if (this.flagcarried == world)
+ if (this.flagcarried == NULL)
{
havocbot_ctf_reset_role(this);
return;
navigation_goalrating_start(this);
// if enemies are closer to our base, go there
- entity closestplayer = world;
+ entity closestplayer = NULL;
float distance, bestdistance = 10000;
FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), LAMBDA(
distance = vlen(org - it.origin);
if(frag_target.flagcarried)
{
entity tmp_entity = frag_target.flagcarried;
- ctf_Handle_Throw(frag_target, world, DROP_NORMAL);
- tmp_entity.ctf_dropper = world;
+ ctf_Handle_Throw(frag_target, NULL, DROP_NORMAL);
+ tmp_entity.ctf_dropper = NULL;
}
}
void ctf_RemovePlayer(entity player)
{
if(player.flagcarried)
- { ctf_Handle_Throw(player, world, DROP_NORMAL); }
+ { ctf_Handle_Throw(player, NULL, DROP_NORMAL); }
for(entity flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext)
{
- if(flag.pass_sender == player) { flag.pass_sender = world; }
- if(flag.pass_target == player) { flag.pass_target = world; }
- if(flag.ctf_dropper == player) { flag.ctf_dropper = world; }
+ if(flag.pass_sender == player) { flag.pass_sender = NULL; }
+ if(flag.pass_target == player) { flag.pass_target = NULL; }
+ if(flag.ctf_dropper == player) { flag.ctf_dropper = NULL; }
}
}
if(player.flagcarried)
if(!autocvar_g_ctf_portalteleport)
- { ctf_Handle_Throw(player, world, DROP_NORMAL); }
+ { ctf_Handle_Throw(player, NULL, DROP_NORMAL); }
}
MUTATOR_HOOKFUNCTION(ctf, PlayerUseKey)
// pass the flag to a team mate
if(autocvar_g_ctf_pass)
{
- entity head, closest_target = world;
+ entity head, closest_target = NULL;
head = WarpZone_FindRadius(player.origin, autocvar_g_ctf_pass_radius, true);
while(head) // find the closest acceptable target to pass to
{
player.throw_prevtime = time;
player.throw_count = 1;
- ctf_Handle_Throw(player, world, DROP_THROW);
+ ctf_Handle_Throw(player, NULL, DROP_THROW);
return true;
}
else
if(player.throw_count >= autocvar_g_ctf_throw_punish_count) { player.throw_count = -1; }
player.throw_prevtime = time;
- ctf_Handle_Throw(player, world, DROP_THROW);
+ ctf_Handle_Throw(player, NULL, DROP_THROW);
return true;
}
}
}
else // create a normal help me waypointsprite
{
- WaypointSprite_Spawn(WP_Helpme, waypointsprite_deployed_lifetime, waypointsprite_limitedrange, player, FLAG_WAYPOINT_OFFSET, world, player.team, player, wps_helpme, false, RADARICON_HELPME);
+ WaypointSprite_Spawn(WP_Helpme, waypointsprite_deployed_lifetime, waypointsprite_limitedrange, player, FLAG_WAYPOINT_OFFSET, NULL, player.team, player, wps_helpme, false, RADARICON_HELPME);
WaypointSprite_Ping(player.wps_helpme);
}
if(!autocvar_g_ctf_allow_vehicle_carry && !autocvar_g_ctf_allow_vehicle_touch)
{
- ctf_Handle_Throw(player, world, DROP_NORMAL);
+ ctf_Handle_Throw(player, NULL, DROP_NORMAL);
}
else
{
setorigin(player.flagcarried, FLAG_CARRY_OFFSET);
player.flagcarried.scale = FLAG_SCALE;
player.flagcarried.angles = '0 0 0';
- player.flagcarried.nodrawtoclient = world;
+ player.flagcarried.nodrawtoclient = NULL;
return true;
}
}
if(player.flagcarried)
{
- Send_Notification(NOTIF_ALL, world, MSG_INFO, ((player.flagcarried.team) ? APP_TEAM_ENT(player.flagcarried, INFO_CTF_FLAGRETURN_ABORTRUN) : INFO_CTF_FLAGRETURN_ABORTRUN_NEUTRAL));
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((player.flagcarried.team) ? APP_TEAM_ENT(player.flagcarried, INFO_CTF_FLAGRETURN_ABORTRUN) : INFO_CTF_FLAGRETURN_ABORTRUN_NEUTRAL));
ctf_RespawnFlag(player.flagcarried);
return true;
}
entity frag_target = M_ARGV(0, entity);
if(frag_target.flagcarried)
- ctf_Handle_Throw(frag_target, world, DROP_THROW);
+ ctf_Handle_Throw(frag_target, NULL, DROP_THROW);
}
// scoreboard setup
void ctf_ScoreRules(int teams)
{
- CheckAllowedTeams(world);
+ CheckAllowedTeams(NULL);
ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, true);
ScoreInfo_SetLabel_TeamScore (ST_CTF_CAPS, "caps", SFL_SORT_PRIO_PRIMARY);
ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
ctf_teams = bound(2, ctf_teams, 4);
// if no teams are found, spawn defaults
- if(find(world, classname, "ctf_team") == world)
+ if(find(NULL, classname, "ctf_team") == NULL)
{
LOG_TRACE("No \"ctf_team\" entities found on this map, creating them anyway.\n");
ctf_SpawnTeam("Red", NUM_TEAM_1 - 1);
ctf_captureshield_max_ratio = autocvar_g_ctf_shield_max_ratio;
ctf_captureshield_force = autocvar_g_ctf_shield_force;
- InitializeEntity(world, ctf_DelayedInit, INITPRIO_GAMETYPE);
+ InitializeEntity(NULL, ctf_DelayedInit, INITPRIO_GAMETYPE);
}
#endif
void cts_EventLog(string mode, entity actor) // use an alias for easy changing and quick editing later
{
if(autocvar_sv_eventlog)
- GameLogEcho(strcat(":cts:", mode, ":", ((actor != world) ? (strcat(":", ftos(actor.playerid))) : "")));
+ GameLogEcho(strcat(":cts:", mode, ":", ((actor != NULL) ? (strcat(":", ftos(actor.playerid))) : "")));
}
void KillIndicator_Think(entity this);
{
float s;
- Score_NicePrint(world);
+ Score_NicePrint(NULL);
race_ClearRecords();
PlayerScore_Sort(race_place, 0, 1, 0);
if(player.killindicator && player.killindicator.health == 1) // player.killindicator.health == 1 means that the kill indicator was spawned by CTS_ClientKill
{
remove(player.killindicator);
- player.killindicator = world;
+ player.killindicator = NULL;
ClientKill_Now(player); // allow instant kill in this case
return;
void dom_EventLog(string mode, float team_before, entity actor) // use an alias for easy changing and quick editing later
{
if(autocvar_sv_eventlog)
- GameLogEcho(strcat(":dom:", mode, ":", ftos(team_before), ((actor != world) ? (strcat(":", ftos(actor.playerid))) : "")));
+ GameLogEcho(strcat(":dom:", mode, ":", ftos(team_before), ((actor != NULL) ? (strcat(":", ftos(actor.playerid))) : "")));
}
void set_dom_state(entity e)
this.cnt = -1;
dom_EventLog("taken", this.team, this.dmg_inflictor);
- this.dmg_inflictor = world;
+ this.dmg_inflictor = NULL;
this.goalentity = head;
this.model = head.mdl;
if(domination_roundbased)
bprint(sprintf("^3%s^3%s\n", head.netname, this.message));
else
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_DOMINATION_CAPTURE_TIME, head.netname, this.message, points, wait_time);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_DOMINATION_CAPTURE_TIME, head.netname, this.message, points, wait_time);
if(this.enemy.playerid == this.enemy_playerid)
PlayerScore_Add(this.enemy, SP_DOM_TAKES, 1);
else
- this.enemy = world;
+ this.enemy = NULL;
if (head.noise != "")
if(this.enemy)
WaypointSprite_UpdateSprites(this.sprite, msg, WP_Null, WP_Null);
total_pps = 0, pps_red = 0, pps_blue = 0, pps_yellow = 0, pps_pink = 0;
- for(head = world; (head = find(head, classname, "dom_controlpoint")) != world; )
+ for(head = NULL; (head = find(head, classname, "dom_controlpoint")) != NULL; )
FOREACH_ENTITY_CLASS("dom_controlpoint", true, LAMBDA(
if (autocvar_g_domination_point_amt)
points = autocvar_g_domination_point_amt;
PlayerScore_Add(this.enemy, SP_DOM_TICKS, fragamt);
}
else
- this.enemy = world;
+ this.enemy = NULL;
}
}
return;
// only valid teams can claim it
- entity head = find(world, classname, "dom_team");
+ entity head = find(NULL, classname, "dom_team");
while (head && head.team != other.team)
head = find(head, classname, "dom_team");
if (!head || head.netname == "" || head == this.goalentity)
//this.think = dompoint_captured;
// go to neutral team in the mean time
- head = find(world, classname, "dom_team");
+ head = find(NULL, classname, "dom_team");
while (head && head.netname != "")
head = find(head, classname, "dom_team");
- if(head == world)
+ if(head == NULL)
return;
WaypointSprite_UpdateSprites(this.sprite, WP_DomNeut, WP_Null, WP_Null);
{
entity head;
// find the spawnfunc_dom_team representing unclaimed points
- head = find(world, classname, "dom_team");
+ head = find(NULL, classname, "dom_team");
while(head && head.netname != "")
head = find(head, classname, "dom_team");
if (!head)
{
entity e;
total_controlpoints = redowned = blueowned = yellowowned = pinkowned = 0;
- for(e = world; (e = find(e, classname, "dom_controlpoint")) != world; )
+ for(e = NULL; (e = find(e, classname, "dom_controlpoint")) != NULL; )
{
++total_controlpoints;
redowned += (e.goalentity.team == NUM_TEAM_1);
{
if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0)
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER);
round_handler_Init(5, autocvar_g_domination_warmup, autocvar_g_domination_round_timelimit);
return 1;
}
if(winner_team > 0)
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
- Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
TeamScore_AddToTeam(winner_team, ST_DOM_CAPS, +1);
}
else if(winner_team == -1)
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_TIED);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_TIED);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_TIED);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_TIED);
}
round_handler_Init(5, autocvar_g_domination_warmup, autocvar_g_domination_round_timelimit);
M_ARGV(0, float) = domination_teams;
string ret_string = "dom_team";
- entity head = find(world, classname, ret_string);
+ entity head = find(NULL, classname, ret_string);
while(head)
{
if(head.netname != "")
void dom_DelayedInit(entity this) // Do this check with a delay so we can wait for teams to be set up.
{
// if no teams are found, spawn defaults
- if(find(world, classname, "dom_team") == world || autocvar_g_domination_teams_override >= 2)
+ if(find(NULL, classname, "dom_team") == NULL || autocvar_g_domination_teams_override >= 2)
{
LOG_TRACE("No \"dom_team\" entities found on this map, creating them anyway.\n");
domination_teams = bound(2, ((autocvar_g_domination_teams_override < 2) ? autocvar_g_domination_default_teams : autocvar_g_domination_teams_override), 4);
dom_spawnteams(domination_teams);
}
- CheckAllowedTeams(world);
+ CheckAllowedTeams(NULL);
domination_teams = ((c4>=0) ? 4 : (c3>=0) ? 3 : 2);
domination_roundbased = autocvar_g_domination_roundbased;
void dom_Initialize()
{
g_domination = true;
- InitializeEntity(world, dom_DelayedInit, INITPRIO_GAMETYPE);
+ InitializeEntity(NULL, dom_DelayedInit, INITPRIO_GAMETYPE);
}
#endif
if(FREEZETAG_ALIVE_TEAMS_OK())
{
if(prev_missing_teams_mask > 0)
- Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_MISSING_TEAMS);
+ Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS);
prev_missing_teams_mask = -1;
return 1;
}
if(total_players == 0)
{
if(prev_missing_teams_mask > 0)
- Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_MISSING_TEAMS);
+ Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS);
prev_missing_teams_mask = -1;
return 0;
}
if(freezetag_teams >= 4) missing_teams_mask += (!pinkalive) * 8;
if(prev_missing_teams_mask != missing_teams_mask)
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_MISSING_TEAMS, missing_teams_mask);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_MISSING_TEAMS, missing_teams_mask);
prev_missing_teams_mask = missing_teams_mask;
}
return 0;
{
if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0)
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER);
FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
it.freezetag_frozen_timeout = 0;
nades_Clear(it);
int winner_team = freezetag_getWinnerTeam();
if(winner_team > 0)
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
- Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
TeamScore_AddToTeam(winner_team, ST_SCORE, +1);
}
else if(winner_team == -1)
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_TIED);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_TIED);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_TIED);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_TIED);
}
FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
entity freezetag_LastPlayerForTeam(entity this)
{
- entity last_pl = world;
+ entity last_pl = NULL;
FOREACH_CLIENT(IS_PLAYER(it) && it != this, LAMBDA(
if(it.health >= 1)
if(!STAT(FROZEN, it))
if(!last_pl)
last_pl = it;
else
- return world;
+ return NULL;
));
return last_pl;
}
freezetag_Freeze(frag_target, frag_attacker);
freezetag_LastPlayerForTeam_Notify(frag_target);
- if(frag_attacker == frag_target || frag_attacker == world)
+ if(frag_attacker == frag_target || frag_attacker == NULL)
{
if(IS_PLAYER(frag_target))
Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_FREEZETAG_SELF);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_SELF, frag_target.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_SELF, frag_target.netname);
}
else
{
Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_FREEZETAG_FROZEN, frag_attacker.netname);
if(IS_PLAYER(frag_attacker))
Send_Notification(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_FREEZETAG_FREEZE, frag_target.netname);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_FREEZE, frag_target.netname, frag_attacker.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_FREEZE, frag_target.netname, frag_attacker.netname);
}
return true;
if(player.freezetag_frozen_timeout == -2) // player was dead
{
- freezetag_Freeze(player, world);
+ freezetag_Freeze(player, NULL);
return true;
}
if(round_handler_IsRoundStarted())
{
Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_SPAWN_LATE);
- freezetag_Freeze(player, world);
+ freezetag_Freeze(player, NULL);
}
return true;
int n;
entity o;
- o = world;
+ o = NULL;
//if(STAT(FROZEN, player))
//if(player.freezetag_frozen_timeout > 0 && time < player.freezetag_frozen_timeout)
//player.iceblock.alpha = ICE_MIN_ALPHA + (ICE_MAX_ALPHA - ICE_MIN_ALPHA) * (player.freezetag_frozen_timeout - time) / (player.freezetag_frozen_timeout - player.freezetag_frozen_time);
if(n == -1)
{
Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_AUTO_REVIVED, autocvar_g_freezetag_frozen_maxtime);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_AUTO_REVIVED, player.netname, autocvar_g_freezetag_frozen_maxtime);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_AUTO_REVIVED, player.netname, autocvar_g_freezetag_frozen_maxtime);
return true;
}
Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_REVIVED, o.netname);
Send_Notification(NOTIF_ONE, o, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED, player.netname, o.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED, player.netname, o.netname);
}
FOREACH_CLIENT(IS_PLAYER(it) && it.reviving, LAMBDA(
if((mon.spawnflags & MONSTER_TYPE_FLY) || (mon.spawnflags & MONSTER_TYPE_SWIM) || ((mon.spawnflags & MON_FLAG_SUPERMONSTER) && supermonster_count >= 1))
continue; // flying/swimming monsters not yet supported
- RandomSelection_Add(world, i, string_null, 1, 1);
+ RandomSelection_Add(NULL, i, string_null, 1, 1);
}
return RandomSelection_chosen_float;
RandomSelection_Init();
- for(e = world;(e = find(e, classname, "invasion_spawnpoint")); )
+ for(e = NULL;(e = find(e, classname, "invasion_spawnpoint")); )
{
RandomSelection_Add(e, 0, string_null, 1, ((time >= e.spawnshieldtime) ? 0.2 : 1)); // give recently used spawnpoints a very low rating
e.spawnshieldtime = time + autocvar_g_invasion_spawnpoint_spawn_delay;
spawn_point = invasion_PickSpawn();
- if(spawn_point == world)
+ if(spawn_point == NULL)
{
LOG_TRACE("Warning: couldn't find any invasion_spawnpoint spawnpoints, attempting to spawn monsters in random locations\n");
entity e = spawn();
setsize(e, (get_monsterinfo(mon)).mins, (get_monsterinfo(mon)).maxs);
if(MoveToRandomMapLocation(e, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 10, 1024, 256))
- monster = spawnmonster("", mon, world, world, e.origin, false, false, 2);
+ monster = spawnmonster("", mon, NULL, NULL, e.origin, false, false, 2);
else return;
setthink(e, SUB_Remove);
else
{
RandomSelection_Init();
- if(inv_monsters_perteam[NUM_TEAM_1] > 0) RandomSelection_Add(world, NUM_TEAM_1, string_null, 1, 1);
- if(inv_monsters_perteam[NUM_TEAM_2] > 0) RandomSelection_Add(world, NUM_TEAM_2, string_null, 1, 1);
- if(invasion_teams >= 3) if(inv_monsters_perteam[NUM_TEAM_3] > 0) { RandomSelection_Add(world, NUM_TEAM_3, string_null, 1, 1); }
- if(invasion_teams >= 4) if(inv_monsters_perteam[NUM_TEAM_4] > 0) { RandomSelection_Add(world, NUM_TEAM_4, string_null, 1, 1); }
+ if(inv_monsters_perteam[NUM_TEAM_1] > 0) RandomSelection_Add(NULL, NUM_TEAM_1, string_null, 1, 1);
+ if(inv_monsters_perteam[NUM_TEAM_2] > 0) RandomSelection_Add(NULL, NUM_TEAM_2, string_null, 1, 1);
+ if(invasion_teams >= 3) if(inv_monsters_perteam[NUM_TEAM_3] > 0) { RandomSelection_Add(NULL, NUM_TEAM_3, string_null, 1, 1); }
+ if(invasion_teams >= 4) if(inv_monsters_perteam[NUM_TEAM_4] > 0) { RandomSelection_Add(NULL, NUM_TEAM_4, string_null, 1, 1); }
monster.team = RandomSelection_chosen_float;
}
{
FOREACH_ENTITY_FLAGS(flags, FL_MONSTER, LAMBDA(Monster_Remove(it)));
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER);
round_handler_Init(5, autocvar_g_invasion_warmup, autocvar_g_invasion_round_timelimit);
return 1;
}
else if(inv_numkilled < inv_maxspawned)
return 0;
- entity winner = world;
+ entity winner = NULL;
float winning_score = 0, winner_team = 0;
{
if(winner_team)
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
- Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
}
}
else if(winner)
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_PLAYER_WIN, winner.netname);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_PLAYER_WIN, winner.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_PLAYER_WIN, winner.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_PLAYER_WIN, winner.netname);
}
round_handler_Init(5, autocvar_g_invasion_warmup, autocvar_g_invasion_round_timelimit);
mon.monster_skill = inv_monsterskill;
if((get_monsterinfo(mon.monsterid)).spawnflags & MON_FLAG_SUPERMONSTER)
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_INVASION_SUPERMONSTER, mon.monster_name);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_INVASION_SUPERMONSTER, mon.monster_name);
mon.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_BOTCLIP | DPCONTENTS_MONSTERCLIP;
}
void invasion_ScoreRules(float inv_teams)
{
- if(inv_teams) { CheckAllowedTeams(world); }
+ if(inv_teams) { CheckAllowedTeams(NULL); }
ScoreRules_basics(inv_teams, 0, 0, false);
if(inv_teams) ScoreInfo_SetLabel_TeamScore(ST_INV_KILLS, "frags", SFL_SORT_PRIO_PRIMARY);
ScoreInfo_SetLabel_PlayerScore(SP_KILLS, "frags", ((inv_teams) ? SFL_SORT_PRIO_SECONDARY : SFL_SORT_PRIO_PRIMARY));
}
}
- InitializeEntity(world, invasion_DelayedInit, INITPRIO_GAMETYPE);
+ InitializeEntity(NULL, invasion_DelayedInit, INITPRIO_GAMETYPE);
}
#endif
void ka_EventLog(string mode, entity actor) // use an alias for easy changing and quick editing later
{
if(autocvar_sv_eventlog)
- GameLogEcho(strcat(":ka:", mode, ((actor != world) ? (strcat(":", ftos(actor.playerid))) : "")));
+ GameLogEcho(strcat(":ka:", mode, ((actor != NULL) ? (strcat(":", ftos(actor.playerid))) : "")));
}
void ka_TouchEvent(entity this);
Send_Effect(EFFECT_ELECTRO_COMBO, oldballorigin, '0 0 0', 1);
Send_Effect(EFFECT_ELECTRO_COMBO, this.origin, '0 0 0', 1);
- WaypointSprite_Spawn(WP_KaBall, 0, 0, this, '0 0 64', world, this.team, this, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER);
+ WaypointSprite_Spawn(WP_KaBall, 0, 0, this, '0 0 64', NULL, this.team, this, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER);
WaypointSprite_Ping(this.waypointsprite_attachedforcarrier);
sound(this, CH_TRIGGER, SND_KA_RESPAWN, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
// messages and sounds
ka_EventLog("pickup", other);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_KEEPAWAY_PICKUP, other.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_KEEPAWAY_PICKUP, other.netname);
Send_Notification(NOTIF_ALL_EXCEPT, other, MSG_CENTER, CENTER_KEEPAWAY_PICKUP, other.netname);
Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_KEEPAWAY_PICKUP_SELF);
sound(this.owner, CH_TRIGGER, SND_KA_PICKEDUP, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
if(!ball) { return; }
// reset the ball
- setattachment(ball, world, "");
+ setattachment(ball, NULL, "");
ball.movetype = MOVETYPE_BOUNCE;
ball.wait = time + 1;
settouch(ball, ka_TouchEvent);
setorigin(ball, plyr.origin + '0 0 10');
ball.velocity = '0 0 200' + '0 100 0'*crandom() + '100 0 0'*crandom();
ball.owner.ballcarried = world; // I hope nothing checks to see if the world has the ball in the rest of my code :P
- ball.owner = world;
+ ball.owner = NULL;
// reset the player effects
plyr.glow_trail = false;
// messages and sounds
ka_EventLog("dropped", plyr);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_KEEPAWAY_DROPPED, plyr.netname);
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEEPAWAY_DROPPED, plyr.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_KEEPAWAY_DROPPED, plyr.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_KEEPAWAY_DROPPED, plyr.netname);
sound(other, CH_TRIGGER, SND_KA_DROPPED, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
// scoring
// PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless.
// waypoints
- WaypointSprite_Spawn(WP_KaBall, 0, 0, ball, '0 0 64', world, ball.team, ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER);
+ WaypointSprite_Spawn(WP_KaBall, 0, 0, ball, '0 0 64', NULL, ball.team, ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER);
WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
WaypointSprite_Ping(ball.waypointsprite_attachedforcarrier);
WaypointSprite_Kill(plyr.waypointsprite_attachedforcarrier);
e.pushable = true;
e.reset = ka_Reset;
settouch(e, ka_TouchEvent);
- e.owner = world;
+ e.owner = NULL;
ka_ball = e;
InitializeEntity(e, ka_RespawnBall, INITPRIO_SETLOCATION); // is this the right priority? Neh, I have no idea.. Well-- it works! So.
if(key.owner)
key.owner.kh_state |= pow(32, key.count) * 31;
}
- //print(ftos((nextent(world)).kh_state), "\n");
+ //print(ftos((nextent(NULL)).kh_state), "\n");
}
setorigin(first, first.origin + 0.5 * KH_PLAYER_ATTACHMENT_DIST);
}
// in any case:
- setattachment(key, world, "");
+ setattachment(key, NULL, "");
setorigin(key, key.owner.origin + '0 0 1' * (STAT(PL_MIN, NULL).z - KH_KEY_MIN_z));
key.angles = key.owner.angles;
#else
setorigin(key, key.owner.origin + key.origin.z * '0 0 1');
- setattachment(key, world, "");
+ setattachment(key, NULL, "");
key.angles_y += key.owner.angles.y;
#endif
key.flags = FL_ITEM;
if(key.kh_next)
key.kh_next.kh_prev = key.kh_prev;
key.kh_prev.kh_next = key.kh_next;
- key.kh_next = world;
- key.kh_prev = world;
+ key.kh_next = NULL;
+ key.kh_prev = NULL;
- if(key.owner.kh_next == world)
+ if(key.owner.kh_next == NULL)
{
// No longer a key carrier
if(!kh_no_radar_circles)
kh_Key_Attach(key);
- if(key.kh_next == world)
+ if(key.kh_next == NULL)
{
// player is now a key carrier
entity wp = WaypointSprite_AttachCarrier(WP_Null, player, RADARICON_FLAGCARRIER);
// moved that here, also update if there's no player
kh_update_state();
- key.pusher = world;
+ key.pusher = NULL;
ownerteam = kh_Key_AllOwnedByWhichTeam();
if(ownerteam != ownerteam0)
PlayerScore_Add(player, SP_KH_PICKUPS, 1);
}
key.kh_dropperteam = 0;
- Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT(key, INFO_KEYHUNT_PICKUP), player.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_ENT(key, INFO_KEYHUNT_PICKUP), player.netname);
kh_Key_AssignTo(key, player); // this also updates .kh_state
}
{
entity o;
o = key.owner;
- kh_Key_AssignTo(key, world);
+ kh_Key_AssignTo(key, NULL);
if(o) // it was attached
WaypointSprite_Kill(key.waypointsprite_attachedforcarrier);
else // it was dropped
kh_Key_Remove(key);
kh_no_radar_circles = false;
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEYHUNT_ROUNDSTART, autocvar_g_balance_keyhunt_delay_round);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_KEYHUNT_ROUNDSTART, autocvar_g_balance_keyhunt_delay_round);
kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round, kh_StartRound);
}
first = false;
}
- Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM(teem, INFO_KEYHUNT_CAPTURE), keyowner);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(teem, INFO_KEYHUNT_CAPTURE), keyowner);
first = true;
midpoint = '0 0 0';
midpoint += thisorigin;
if(!first)
- te_lightning2(world, lastorigin, thisorigin);
+ te_lightning2(NULL, lastorigin, thisorigin);
lastorigin = thisorigin;
if(first)
firstorigin = thisorigin;
}
if(kh_teams > 2)
{
- te_lightning2(world, lastorigin, firstorigin);
+ te_lightning2(NULL, lastorigin, firstorigin);
}
midpoint = midpoint * (1 / kh_teams);
te_customflash(midpoint, 1000, 1, Team_ColorRGB(teem) * 0.5 + '0.5 0.5 0.5'); // make the color >=0.5 in each component
float keys;
float f;
- attacker = world;
+ attacker = NULL;
if(lostkey.pusher)
if(lostkey.pusher.team != teem)
if(IS_PLAYER(lostkey.pusher))
if(attacker)
{
if(lostkey.kh_previous_owner)
- kh_Scores_Event(lostkey.kh_previous_owner, world, "pushed", 0, -autocvar_g_balance_keyhunt_score_push);
+ kh_Scores_Event(lostkey.kh_previous_owner, NULL, "pushed", 0, -autocvar_g_balance_keyhunt_score_push);
// don't actually GIVE him the -nn points, just log
- kh_Scores_Event(attacker, world, "push", autocvar_g_balance_keyhunt_score_push, 0);
+ kh_Scores_Event(attacker, NULL, "push", autocvar_g_balance_keyhunt_score_push, 0);
PlayerScore_Add(attacker, SP_KH_PUSHES, 1);
//centerprint(attacker, "Your push is the best!"); // does this really need to exist?
}
++keys;
if(lostkey.kh_previous_owner)
- kh_Scores_Event(lostkey.kh_previous_owner, world, "destroyed", 0, -autocvar_g_balance_keyhunt_score_destroyed);
+ kh_Scores_Event(lostkey.kh_previous_owner, NULL, "destroyed", 0, -autocvar_g_balance_keyhunt_score_destroyed);
// don't actually GIVE him the -nn points, just log
if(lostkey.kh_previous_owner.playerid == lostkey.kh_previous_owner_playerid)
if(key.owner && key.team != teem)
{
f = DistributeEvenly_Get(of);
- kh_Scores_Event(key.owner, world, "destroyed_holdingkey", f, 0);
+ kh_Scores_Event(key.owner, NULL, "destroyed_holdingkey", f, 0);
}
fragsleft = DistributeEvenly_Get(players);
FOREACH_CLIENT(IS_PLAYER(it) && it.team == thisteam, LAMBDA(
f = DistributeEvenly_Get(1);
- kh_Scores_Event(it, world, "destroyed", f, 0);
+ kh_Scores_Event(it, NULL, "destroyed", f, 0);
));
--j;
}
}
- Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT(lostkey, INFO_KEYHUNT_LOST), lostkey.kh_previous_owner.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_ENT(lostkey, INFO_KEYHUNT_LOST), lostkey.kh_previous_owner.netname);
play2all(SND(KH_DESTROY));
te_tarexplosion(lostkey.origin);
void key_reset(entity this)
{
- kh_Key_AssignTo(this, world);
+ kh_Key_AssignTo(this, NULL);
kh_Key_Remove(this);
}
Send_Notification(NOTIF_ONE, initial_owner, MSG_CENTER, APP_TEAM_NUM(initial_owner.team, CENTER_KEYHUNT_START));
- WaypointSprite_Spawn(WP_KeyDropped, 0, 0, key, '0 0 1' * KH_KEY_WP_ZSHIFT, world, key.team, key, waypointsprite_attachedforcarrier, false, RADARICON_FLAG);
+ WaypointSprite_Spawn(WP_KeyDropped, 0, 0, key, '0 0 1' * KH_KEY_WP_ZSHIFT, NULL, key.team, key, waypointsprite_attachedforcarrier, false, RADARICON_FLAG);
key.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = kh_Key_waypointsprite_visible_for_player;
kh_Key_AssignTo(key, initial_owner);
kh_Scores_Event(player, key, "dropkey", 0, 0);
PlayerScore_Add(player, SP_KH_LOSSES, 1);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT(key, INFO_KEYHUNT_DROP), player.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_ENT(key, INFO_KEYHUNT_DROP), player.netname);
- kh_Key_AssignTo(key, world);
+ kh_Key_AssignTo(key, NULL);
makevectors(player.v_angle);
key.velocity = W_CalculateProjectileVelocity(player, player.velocity, autocvar_g_balance_keyhunt_throwvelocity * v_forward, false);
- key.pusher = world;
+ key.pusher = NULL;
key.pushltime = time + autocvar_g_balance_keyhunt_protecttime;
key.kh_dropperteam = key.team;
entity mypusher;
if(player.kh_next)
{
- mypusher = world;
+ mypusher = NULL;
if(player.pusher)
if(time < player.pushltime)
mypusher = player.pusher;
{
kh_Scores_Event(player, key, "losekey", 0, 0);
PlayerScore_Add(player, SP_KH_LOSSES, 1);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT(key, INFO_KEYHUNT_LOST), player.netname);
- kh_Key_AssignTo(key, world);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_ENT(key, INFO_KEYHUNT_LOST), player.netname);
+ kh_Key_AssignTo(key, NULL);
makevectors('-1 0 0' * (45 + 45 * random()) + '0 360 0' * random());
key.velocity = W_CalculateProjectileVelocity(player, player.velocity, autocvar_g_balance_keyhunt_dropvelocity * v_forward, false);
key.pusher = mypusher;
if(KH_READY_TEAMS_OK())
{
if(prev_missing_teams_mask > 0)
- Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_MISSING_TEAMS);
+ Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS);
prev_missing_teams_mask = -1;
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEYHUNT_ROUNDSTART, autocvar_g_balance_keyhunt_delay_round);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_KEYHUNT_ROUNDSTART, autocvar_g_balance_keyhunt_delay_round);
kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round, kh_StartRound);
}
else
if(player_count == 0)
{
if(prev_missing_teams_mask > 0)
- Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_MISSING_TEAMS);
+ Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS);
prev_missing_teams_mask = -1;
}
else
if(kh_teams >= 4) missing_teams_mask += boolean(p4) * 8;
if(prev_missing_teams_mask != missing_teams_mask)
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_MISSING_TEAMS, missing_teams_mask);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_MISSING_TEAMS, missing_teams_mask);
prev_missing_teams_mask = missing_teams_mask;
}
}
void kh_EnableTrackingDevice() // runs after each round
{
- Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_KEYHUNT);
- Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_KEYHUNT_OTHER);
+ Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_KEYHUNT);
+ Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_KEYHUNT_OTHER);
kh_tracking_enabled = true;
}
return;
}
- Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_KEYHUNT);
- Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CPID_KEYHUNT_OTHER);
+ Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_KEYHUNT);
+ Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_KEYHUNT_OTHER);
for(i = 0; i < kh_teams; ++i)
{
teem = kh_Team_ByID(i);
players = 0;
- entity my_player = world;
+ entity my_player = NULL;
FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
if(!IS_DEAD(it) && !PHYS_INPUT_BUTTON_CHAT(it) && it.team == teem)
{
}
kh_tracking_enabled = false;
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_KEYHUNT_SCAN, autocvar_g_balance_keyhunt_delay_tracking);
+ Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_KEYHUNT_SCAN, autocvar_g_balance_keyhunt_delay_tracking);
kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_tracking, kh_EnableTrackingDevice);
}
entity k;
float nk;
nk = 0;
- for(k = targ.kh_next; k != world; k = k.kh_next)
+ for(k = targ.kh_next; k != NULL; k = k.kh_next)
++nk;
kh_Scores_Event(attacker, targ.kh_next, "carrierfrag", -nk * autocvar_g_balance_keyhunt_score_collect, 0);
}
// to be called before intermission
kh_FinishRound();
remove(kh_controller);
- kh_controller = world;
+ kh_controller = NULL;
}
// legacy bot role
int l = LMS_NewPlayerLives();
- head = find(world, classname, STR_PLAYER);
+ head = find(NULL, classname, STR_PLAYER);
if(head)
have_player = true;
head2 = find(head, classname, STR_PLAYER);
if(player.killcount != FRAGS_SPECTATOR)
if(PlayerScore_Add(player, SP_LMS_RANK, 0) > 0 && player.lms_spectate_warning != 2)
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_LMS_NOLIVES, player.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_LMS_NOLIVES, player.netname);
else
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_LMS_FORFEIT, player.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_LMS_FORFEIT, player.netname);
}
MUTATOR_HOOKFUNCTION(lms, ClientDisconnect)
this.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
navigation_goalrating_start(this);
- for(e = world; (e = find(e, classname, "trigger_race_checkpoint")) != world; )
+ for(e = NULL; (e = find(e, classname, "trigger_race_checkpoint")) != NULL; )
{
if(e.cnt == this.race_checkpoint)
{
void race_EventLog(string mode, entity actor) // use an alias for easy changing and quick editing later
{
if(autocvar_sv_eventlog)
- GameLogEcho(strcat(":race:", mode, ":", ((actor != world) ? (strcat(":", ftos(actor.playerid))) : "")));
+ GameLogEcho(strcat(":race:", mode, ":", ((actor != NULL) ? (strcat(":", ftos(actor.playerid))) : "")));
}
float WinningCondition_Race(float fraglimit)
{
float s;
- Score_NicePrint(world);
+ Score_NicePrint(NULL);
race_ClearRecords();
PlayerScore_Sort(race_place, 0, 1, 0);
{
if (time > 1) // game loads at time 1
error("This is a game type and it cannot be added at runtime.");
- InitializeEntity(world, tdm_DelayedInit, INITPRIO_GAMETYPE);
+ InitializeEntity(NULL, tdm_DelayedInit, INITPRIO_GAMETYPE);
ActivateTeamplay();
SetLimits(autocvar_g_tdm_point_limit, autocvar_g_tdm_point_leadlimit, autocvar_timelimit_override, -1);
void tdm_DelayedInit(entity this)
{
// if no teams are found, spawn defaults
- if(find(world, classname, "tdm_team") == world)
+ if(find(NULL, classname, "tdm_team") == NULL)
{
LOG_TRACE("No \"tdm_team\" entities found on this map, creating them anyway.\n");
node = findchainentity(owner,openlist);
if(!node)
- return world;
+ return NULL;
bestnode = node;
while(node)
}
if(node == best_open_node)
- best_open_node = world;
+ best_open_node = NULL;
++pathlib_closed_cnt;
--pathlib_open_cnt;
void pathlib_cleanup()
{
- best_open_node = world;
+ best_open_node = NULL;
//return;
entity node;
- node = findfloat(world,is_path_node, true);
+ node = findfloat(NULL,is_path_node, true);
while(node)
{
/*
node.pathlib_node_g = 0;
node.pathlib_node_h = 0;
node.pathlib_node_f = 0;
- node.path_prev = world;
+ node.path_prev = NULL;
*/
dumpnode(node);
if(closedlist)
remove(closedlist);
- openlist = world;
- closedlist = world;
+ openlist = NULL;
+ closedlist = NULL;
}
//to_z += 32;
LOG_TRACE("AStar init\n");
- path = pathlib_mknode(from, world);
+ path = pathlib_mknode(from, NULL);
pathlib_close_node(path, to);
if(pathlib_foundgoal)
{
LOG_TRACE("AStar path fail.\n");
pathlib_cleanup();
- return world;
+ return NULL;
}
best_open_node = pathlib_getbestopen();
LOG_TRACE("Nodes - closed: ", ftos(pathlib_closed_cnt),"\n");
pathlib_cleanup();
- return world;
+ return NULL;
}
best_open_node = pathlib_getbestopen();
ftime = gettime(GETTIME_REALTIME);
ptime = ftime - ptime;
- start = path_build(world,path.origin,world,world);
- end = path_build(world,goal_node.origin,world,start);
+ start = path_build(NULL,path.origin,NULL,NULL);
+ end = path_build(NULL,goal_node.origin,NULL,start);
ln = end;
open = goal_node;
pathlib_cleanup();
- return world;
+ return NULL;
}
wp.pathlib_list = closedlist;
if(wp == best_open_node)
- best_open_node = world;
+ best_open_node = NULL;
if(wp == goal_node)
pathlib_foundgoal = true;
// FIXME! presisted chain for better preformance
for(n = findchain(classname, "waypoint"); n; n = n.chain)
{
- n.pathlib_list = world;
+ n.pathlib_list = NULL;
n.pathlib_node_g = 0;
n.pathlib_node_f = 0;
n.pathlib_node_h = 0;
if(pathlib_open_cnt <= 0)
{
LOG_TRACE("pathlib_waypointpath: Start waypoint not linked! aborting.\n");
- return world;
+ return NULL;
}
- return world;
+ return NULL;
}
entity pathlib_waypointpath_step()
if(!n)
{
LOG_TRACE("Cannot find best open node, abort.\n");
- return world;
+ return NULL;
}
pathlib_wpp_close(n);
LOG_TRACE("Expanding ",ftos(pathlib_wpp_expand(n))," links\n");
LOG_TRACE("Target found. Rebuilding and filtering path...\n");
buildpath_nodefilter = buildpath_nodefilter_none;
- start = path_build(world, start_node.origin, world, world);
- end = path_build(world, goal_node.origin, world, start);
+ start = path_build(NULL, start_node.origin, NULL, NULL);
+ end = path_build(NULL, goal_node.origin, NULL, start);
ln = end;
for(open = goal_node; open.path_prev != start_node; open = open.path_prev)
return start;
}
- return world;
+ return NULL;
}
void plas_think(entity this)
{
node = node.chain;
}
- return world;
+ return NULL;
}
float tile_check_cross(entity this, vector where)
void Portal_Disconnect(entity teleporter, entity destination)
{
- teleporter.enemy = world;
- destination.enemy = world;
+ teleporter.enemy = NULL;
+ destination.enemy = NULL;
Portal_MakeBrokenPortal(teleporter);
Portal_MakeBrokenPortal(destination);
}
}
if(portal == portal.aiment.portal_in)
- portal.aiment.portal_in = world;
+ portal.aiment.portal_in = NULL;
if(portal == portal.aiment.portal_out)
- portal.aiment.portal_out = world;
- //portal.aiment = world;
+ portal.aiment.portal_out = NULL;
+ //portal.aiment = NULL;
// makes the portal vanish
if(killed)
o = this.aiment;
this.solid = SOLID_BBOX;
- this.aiment = world;
+ this.aiment = NULL;
g = frametime * '0 0 -1' * autocvar_sv_gravity;
fixedmakevectors(ang);
if(!CheckWireframeBox(own, org - 48 * v_right - 48 * v_up + 16 * v_forward, 96 * v_right, 96 * v_up, 96 * v_forward))
- return world;
+ return NULL;
portal = new(portal);
portal.aiment = own;
if(!Portal_FindSafeOrigin(portal))
{
remove(portal);
- return world;
+ return NULL;
}
setsize(portal, '-48 -48 -48', '48 48 48');
{
oldrec = race_readTime(GetMapname(), player_prevpos);
race_SendStatus(0, e); // "fail"
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_RACE_FAIL_RANKED, mynetname, player_prevpos, t, oldrec);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_RACE_FAIL_RANKED, mynetname, player_prevpos, t, oldrec);
return;
}
else if (!newpos)
// no ranking, time worse than the worst ranked
oldrec = race_readTime(GetMapname(), RANKINGS_CNT);
race_SendStatus(0, e); // "fail"
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_RACE_FAIL_UNRANKED, mynetname, RANKINGS_CNT, t, oldrec);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_RACE_FAIL_UNRANKED, mynetname, RANKINGS_CNT, t, oldrec);
return;
}
// if the player does not have a UID we can unfortunately not store the record, as the rankings system relies on UIDs
if(myuid == "")
{
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_RACE_NEW_MISSING_UID, mynetname, t);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_RACE_NEW_MISSING_UID, mynetname, t);
return;
}
if(newpos == player_prevpos)
{
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_RACE_NEW_IMPROVED, mynetname, newpos, t, oldrec);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_RACE_NEW_IMPROVED, mynetname, newpos, t, oldrec);
if(newpos == 1) { race_SendStatus(3, e); } // "new server record"
else { race_SendStatus(1, e); } // "new time"
}
else if(oldrec == 0)
{
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_RACE_NEW_SET, mynetname, newpos, t);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_RACE_NEW_SET, mynetname, newpos, t);
if(newpos == 1) { race_SendStatus(3, e); } // "new server record"
else { race_SendStatus(2, e); } // "new rank"
}
else
{
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_RACE_NEW_BROKEN, mynetname, oldrec_holder, newpos, t, oldrec);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_RACE_NEW_BROKEN, mynetname, oldrec_holder, newpos, t, oldrec);
if(newpos == 1) { race_SendStatus(3, e); } // "new server record"
else { race_SendStatus(2, e); } // "new rank"
}
{
e.race_completed = 1;
MAKE_INDEPENDENT_PLAYER(e);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_RACE_FINISHED, e.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_RACE_FINISHED, e.netname);
ClientData_Touch(e);
}
}
e.race_laptime = 0;
e.race_movetime = e.race_movetime_frac = e.race_movetime_count = 0;
e.race_penalty_accumulator = 0;
- e.race_lastpenalty = world;
+ e.race_lastpenalty = NULL;
if(!IS_REAL_CLIENT(e))
return;
float largest_cp_id = 0;
float cp_amount = 0;
- for(cp = world; (cp = find(cp, classname, "target_checkpoint"));)
+ for(cp = NULL; (cp = find(cp, classname, "target_checkpoint"));)
{
cp_amount += 1;
if(cp.race_checkpoint > largest_cp_id) // update the finish id if someone hit a new checkpoint
{
largest_cp_id = cp.race_checkpoint;
- for(cp = world; (cp = find(cp, classname, "target_stopTimer"));)
+ for(cp = NULL; (cp = find(cp, classname, "target_stopTimer"));)
cp.race_checkpoint = largest_cp_id + 1; // finish line
race_highest_checkpoint = largest_cp_id + 1;
race_timed_checkpoint = largest_cp_id + 1;
- for(cp = world; (cp = find(cp, classname, "target_checkpoint"));)
+ for(cp = NULL; (cp = find(cp, classname, "target_checkpoint"));)
{
if(cp.race_checkpoint == -2) // set defragcpexists to -1 so that the cp id file will be rewritten when someone finishes
defragcpexists = -1;
}
if(cp_amount == 0)
{
- for(cp = world; (cp = find(cp, classname, "target_stopTimer"));)
+ for(cp = NULL; (cp = find(cp, classname, "target_stopTimer"));)
cp.race_checkpoint = 1;
race_highest_checkpoint = 1;
race_timed_checkpoint = 1;
player.race_laptime = time;
player.race_movetime = player.race_movetime_frac = player.race_movetime_count = 0;
player.race_penalty_accumulator = 0;
- player.race_lastpenalty = world;
+ player.race_lastpenalty = NULL;
}
if(g_race_qualifying)
defragcpexists = fh = fopen(strcat("maps/", GetMapname(), ".defragcp"), FILE_WRITE);
if(fh >= 0)
{
- for(cp = world; (cp = find(cp, classname, "target_checkpoint"));)
+ for(cp = NULL; (cp = find(cp, classname, "target_checkpoint"));)
fputs(fh, strcat(cp.targetname, " ", ftos(cp.race_checkpoint), "\n"));
}
fclose(fh);
defragcpexists = -1; // something's wrong in the defrag cp file, set defragcpexists to -1 so that it will be rewritten when someone finishes
continue;
}
- for (entity cp = world; (cp = find(cp, classname, "target_checkpoint"));) {
+ for (entity cp = NULL; (cp = find(cp, classname, "target_checkpoint"));) {
if (argv(0) == cp.targetname) {
cp.race_checkpoint = stof(argv(1));
}
if (race_timed_checkpoint) {
if (defrag_ents) {
- for (entity cp = world; (cp = find(cp, classname, "target_startTimer"));) {
+ for (entity cp = NULL; (cp = find(cp, classname, "target_startTimer"));) {
WaypointSprite_UpdateSprites(cp.sprite, WP_RaceStart, WP_Null, WP_Null);
}
- for (entity cp = world; (cp = find(cp, classname, "target_stopTimer"));) {
+ for (entity cp = NULL; (cp = find(cp, classname, "target_stopTimer"));) {
WaypointSprite_UpdateSprites(cp.sprite, WP_RaceFinish, WP_Null, WP_Null);
}
- for (entity cp = world; (cp = find(cp, classname, "target_checkpoint"));) {
+ for (entity cp = NULL; (cp = find(cp, classname, "target_checkpoint"));) {
if (cp.race_checkpoint == -2) { // something's wrong with the defrag cp file or it has not been written yet, set defragcpexists to -1 so that it will be rewritten when someone finishes
defragcpexists = -1;
}
}
if (defragcpexists != -1) {
float largest_cp_id = 0;
- for (entity cp = world; (cp = find(cp, classname, "target_checkpoint"));) {
+ for (entity cp = NULL; (cp = find(cp, classname, "target_checkpoint"));) {
if (cp.race_checkpoint > largest_cp_id) {
largest_cp_id = cp.race_checkpoint;
}
}
- for (entity cp = world; (cp = find(cp, classname, "target_stopTimer"));) {
+ for (entity cp = NULL; (cp = find(cp, classname, "target_stopTimer"));) {
cp.race_checkpoint = largest_cp_id + 1; // finish line
}
race_highest_checkpoint = largest_cp_id + 1;
race_timed_checkpoint = largest_cp_id + 1;
} else {
- for (entity cp = world; (cp = find(cp, classname, "target_stopTimer"));) {
+ for (entity cp = NULL; (cp = find(cp, classname, "target_stopTimer"));) {
cp.race_checkpoint = 255; // finish line
}
race_highest_checkpoint = 255;
race_timed_checkpoint = 255;
}
} else {
- for (entity cp = world; (cp = find(cp, classname, "trigger_race_checkpoint")); ) {
+ for (entity cp = NULL; (cp = find(cp, classname, "trigger_race_checkpoint")); ) {
if (cp.sprite) {
if (cp.race_checkpoint == 0) {
WaypointSprite_UpdateSprites(cp.sprite, WP_RaceStart, WP_Null, WP_Null);
}
if (defrag_ents) {
- for (entity trigger = world; (trigger = find(trigger, classname, "trigger_multiple")); ) {
- for (entity targ = world; (targ = find(targ, targetname, trigger.target)); ) {
+ for (entity trigger = NULL; (trigger = find(trigger, classname, "trigger_multiple")); ) {
+ for (entity targ = NULL; (targ = find(targ, targetname, trigger.target)); ) {
if (targ.classname == "target_checkpoint" || targ.classname == "target_startTimer" || targ.classname == "target_stopTimer") {
trigger.wait = 0;
trigger.delay = 0;
{
p.race_completed = 1;
MAKE_INDEPENDENT_PLAYER(p);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_RACE_ABANDONED, p.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_RACE_ABANDONED, p.netname);
ClientData_Touch(p);
}
}
this.race_place = 0;
this.race_started = 0;
this.race_respawn_checkpoint = 0;
- this.race_respawn_spotref = world;
+ this.race_respawn_spotref = NULL;
}
void race_RetractPlayer(entity this)
return l; // finish
bestfraction = 1;
- for(cp0 = world; (cp0 = find(cp0, classname, "trigger_race_checkpoint")); )
+ for(cp0 = NULL; (cp0 = find(cp0, classname, "trigger_race_checkpoint")); )
{
if(cp0.race_checkpoint != lastcpindex)
continue;
if(cp0 != lastcp)
continue;
o0 = (cp0.absmin + cp0.absmax) * 0.5;
- for(cp1 = world; (cp1 = find(cp1, classname, "trigger_race_checkpoint")); )
+ for(cp1 = NULL; (cp1 = find(cp1, classname, "trigger_race_checkpoint")); )
{
if(cp1.race_checkpoint != nextcpindex)
continue;
void round_handler_Remove()
{
remove(round_handler);
- round_handler = world;
+ round_handler = NULL;
}
void round_handler_Reset(float next_think);
void round_handler_Remove();
-#define round_handler_IsActive() (round_handler != world)
+#define round_handler_IsActive() (round_handler != NULL)
#define round_handler_AwaitingNextRound() (round_handler.wait)
#define round_handler_CountdownRunning() (!round_handler.wait && round_handler.cnt)
#define round_handler_IsRoundStarted() (!round_handler.wait && !round_handler.cnt)
if(!player.scorekeeper)
error("player has no scorekeeper");
remove(player.scorekeeper);
- player.scorekeeper = world;
+ player.scorekeeper = NULL;
}
float PlayerScore_Add(entity player, float scorefield, float score)
s = GetGametype();
s = strcat(s, ":", autocvar_g_xonoticversion);
s = strcat(s, ":P", ftos(cvar_purechanges_count));
- s = strcat(s, ":S", ftos(nJoinAllowed(this, world)));
+ s = strcat(s, ":S", ftos(nJoinAllowed(this, NULL)));
s = strcat(s, ":F", ftos(serverflags));
s = strcat(s, ":M", modname);
- s = strcat(s, "::", GetPlayerScoreString(world, (fullstatus ? 1 : 2)));
+ s = strcat(s, "::", GetPlayerScoreString(NULL, (fullstatus ? 1 : 2)));
if(teamscores_entities_count)
{
WinningConditionHelper_winnerteam = -1;
WinningConditionHelper_secondteam = -1;
- winnerscorekeeper = world;
- secondscorekeeper = world;
+ winnerscorekeeper = NULL;
+ secondscorekeeper = NULL;
for(t = 0; t < 16; ++t)
{
sk = teamscorekeepers[t];
WinningConditionHelper_lowerisbetter = (teamscores_flags_primary & SFL_LOWER_IS_BETTER);
WinningConditionHelper_zeroisworst = (teamscores_flags_primary & SFL_ZERO_IS_WORST);
- WinningConditionHelper_winner = world; // not supported in teamplay
- WinningConditionHelper_second = world; // not supported in teamplay
+ WinningConditionHelper_winner = NULL; // not supported in teamplay
+ WinningConditionHelper_second = NULL; // not supported in teamplay
}
else
{
- WinningConditionHelper_winner = world;
- WinningConditionHelper_second = world;
- winnerscorekeeper = world;
- secondscorekeeper = world;
+ WinningConditionHelper_winner = NULL;
+ WinningConditionHelper_second = NULL;
+ winnerscorekeeper = NULL;
+ secondscorekeeper = NULL;
FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
sk = it.scorekeeper;
c = PlayerScore_Compare(winnerscorekeeper, sk, 1);
WinningConditionHelper_equality = (PlayerScore_Compare(winnerscorekeeper, secondscorekeeper, 0) == 0);
if(WinningConditionHelper_equality)
- WinningConditionHelper_winner = WinningConditionHelper_second = world;
+ WinningConditionHelper_winner = WinningConditionHelper_second = NULL;
WinningConditionHelper_topscore = winnerscorekeeper.scores_primary;
WinningConditionHelper_secondscore = secondscorekeeper.scores_primary;
entity p, plist, pprev, pbest, pbestprev, pfirst, plast;
float i, j;
- plist = world;
+ plist = NULL;
FOREACH_CLIENT(true, LAMBDA(it.(field) = 0));
});
// Now plist points to the whole list.
- pfirst = plast = world;
+ pfirst = plast = NULL;
i = j = 0;
while(plist)
{
- pprev = pbestprev = world;
+ pprev = pbestprev = NULL;
pbest = plist;
for(p = plist; (pprev = p), (p = p.chain); )
{
}
// remove pbest out of the chain
- if(pbestprev == world)
+ if(pbestprev == NULL)
plist = pbest.chain;
else
pbestprev.chain = pbest.chain;
- pbest.chain = world;
+ pbest.chain = NULL;
++i;
if(!plast || PlayerTeamScore_Compare(plast, pbest, teams, 0))
#include <common/constants.qh>
-entity scores_initialized; // non-world when scores labels/rules have been set
+entity scores_initialized; // non-NULL when scores labels/rules have been set
.float scores[MAX_SCORE];
.float teamscores[MAX_TEAMSCORE];
.float scoreboard_pos;
float WinningConditionHelper_winnerteam; ///< the color of the winning team, or -1 if none
float WinningConditionHelper_secondteam; ///< the color of the second team, or -1 if none
float WinningConditionHelper_equality; ///< we have no winner
-entity WinningConditionHelper_winner; ///< the winning player, or world if none
-entity WinningConditionHelper_second; ///< the second player, or world if none
+entity WinningConditionHelper_winner; ///< the winning player, or NULL if none
+entity WinningConditionHelper_second; ///< the second player, or NULL if none
float WinningConditionHelper_lowerisbetter; ///< lower is better, duh
float WinningConditionHelper_zeroisworst; ///< zero is worst, duh
#define WINNINGCONDITIONHELPER_LOWERISBETTER_WORST 999999999
/**
* Returns score strings for eventlog etc.
- * When called with world, or 0, as argument, they return the labels in the
+ * When called with NULL, or 0, as argument, they return the labels in the
* same order.
* The strings are comma separated; labels that end with !! designate primary,
* labels that end with ! designate high priority.
{
if(teamplay)
{
- CheckAllowedTeams(world);
+ CheckAllowedTeams(NULL);
ScoreRules_basics(((c4>=0) ? 4 : (c3>=0) ? 3 : 2), SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, true);
}
else
float found;
found = 0;
- for(ent = world; (ent = find(ent, targetname, spot.target)); )
+ for(ent = NULL; (ent = find(ent, targetname, spot.target)); )
{
++found;
if(ent.spawn_evalfunc)
{
entity spot, spotlist, spotlistend;
- spotlist = world;
- spotlistend = world;
+ spotlist = NULL;
+ spotlistend = NULL;
Spawn_ScoreAll(this, firstspot, mindist, teamcheck);
}
}
if(spotlistend)
- spotlistend.chain = world;
+ spotlistend.chain = NULL;
return spotlist;
}
float teamcheck;
entity spot, firstspot;
- spot = find (world, classname, "testplayerstart");
+ spot = find (NULL, classname, "testplayerstart");
if (spot)
return spot;
else
{
if(some_spawn_has_been_used)
- return world; // team can't spawn any more, because of actions of other team
+ return NULL; // team can't spawn any more, because of actions of other team
else
error("Cannot find a spawn point - please fix the map!");
}
traceline(this.origin, this.origin + vup_left,MOVE_NOMONSTERS,this);
fup_left = trace_fraction;
- //te_lightning1(world,this.origin, trace_endpos);
+ //te_lightning1(NULL,this.origin, trace_endpos);
vup_right = (v_forward + (v_right * pitch + v_up * pitch)) * length;
traceline(this.origin,this.origin + vup_right ,MOVE_NOMONSTERS,this);
fup_right = trace_fraction;
- //te_lightning1(world,this.origin, trace_endpos);
+ //te_lightning1(NULL,this.origin, trace_endpos);
vdown_left = (v_forward + (v_left * pitch + v_down * pitch)) * length;
traceline(this.origin,this.origin + vdown_left,MOVE_NOMONSTERS,this);
fdown_left = trace_fraction;
- //te_lightning1(world,this.origin, trace_endpos);
+ //te_lightning1(NULL,this.origin, trace_endpos);
vdown_right = (v_forward + (v_right * pitch + v_down * pitch)) * length;
traceline(this.origin,this.origin + vdown_right,MOVE_NOMONSTERS,this);
fdown_right = trace_fraction;
- //te_lightning1(world,this.origin, trace_endpos);
+ //te_lightning1(NULL,this.origin, trace_endpos);
upwish = v_up * (fup_left + fup_right);
downwish = v_down * (fdown_left + fdown_right);
leftwish = v_left * (fup_left + fdown_left);
traceline(this.origin + vofs, this.origin + vofs + vt_left,MOVE_NOMONSTERS,this);
f_left = trace_fraction;
- //te_lightning1(world,this.origin, trace_endpos);
+ //te_lightning1(NULL,this.origin, trace_endpos);
vt_right = (v_forward + (v_right * pitch)) * length;
traceline(this.origin + vofs, this.origin + vofs + vt_right ,MOVE_NOMONSTERS,this);
f_right = trace_fraction;
- //te_lightning1(world,this.origin, trace_endpos);
+ //te_lightning1(NULL,this.origin, trace_endpos);
leftwish = v_left * f_left;
rightwish = v_right * f_right;
if(beamsweep_badpoint(trace_endpos,0))
return i / length;
#ifdef BEAMSTEER_VISUAL
- te_lightning1(world,a+u,b+u);
- te_lightning1(world,b+u,b-d);
+ te_lightning1(NULL,a+u,b+u);
+ te_lightning1(NULL,b+u,b-d);
#endif
a = trace_endpos;
}
Send_Effect(EFFECT_ROCKET_EXPLODE, this.origin, '0 0 0', 1);
this.owner.cnt += 1;
- this.owner = world;
+ this.owner = NULL;
this.nextthink = time;
setthink(this, SUB_Remove);
{
ee = this.enemy;
ee.health = -1;
- this.enemy = world;
+ this.enemy = NULL;
}
if (this.flags & FL_PROJECTILE)
{
if (this.watertype == CONTENT_LAVA)
- Damage (this, world, world, autocvar_g_balance_contents_projectiledamage * autocvar_g_balance_contents_damagerate * this.waterlevel, DEATH_LAVA.m_id, this.origin, '0 0 0');
+ Damage (this, NULL, NULL, autocvar_g_balance_contents_projectiledamage * autocvar_g_balance_contents_damagerate * this.waterlevel, DEATH_LAVA.m_id, this.origin, '0 0 0');
else if (this.watertype == CONTENT_SLIME)
- Damage (this, world, world, autocvar_g_balance_contents_projectiledamage * autocvar_g_balance_contents_damagerate * this.waterlevel, DEATH_SLIME.m_id, this.origin, '0 0 0');
+ Damage (this, NULL, NULL, autocvar_g_balance_contents_projectiledamage * autocvar_g_balance_contents_damagerate * this.waterlevel, DEATH_SLIME.m_id, this.origin, '0 0 0');
}
else
{
this.watersound_finished = time + 0.5;
sound (this, CH_PLAYER_SINGLE, SND_LAVA, VOL_BASE, ATTEN_NORM);
}
- Damage (this, world, world, autocvar_g_balance_contents_playerdamage_lava * autocvar_g_balance_contents_damagerate * this.waterlevel, DEATH_LAVA.m_id, this.origin, '0 0 0');
+ Damage (this, NULL, NULL, autocvar_g_balance_contents_playerdamage_lava * autocvar_g_balance_contents_damagerate * this.waterlevel, DEATH_LAVA.m_id, this.origin, '0 0 0');
if(autocvar_g_balance_contents_playerdamage_lava_burn)
- Fire_AddDamage(this, world, autocvar_g_balance_contents_playerdamage_lava_burn * this.waterlevel, autocvar_g_balance_contents_playerdamage_lava_burn_time * this.waterlevel, DEATH_LAVA.m_id);
+ Fire_AddDamage(this, NULL, autocvar_g_balance_contents_playerdamage_lava_burn * this.waterlevel, autocvar_g_balance_contents_playerdamage_lava_burn_time * this.waterlevel, DEATH_LAVA.m_id);
}
else if (this.watertype == CONTENT_SLIME)
{
this.watersound_finished = time + 0.5;
sound (this, CH_PLAYER_SINGLE, SND_SLIME, VOL_BASE, ATTEN_NORM);
}
- Damage (this, world, world, autocvar_g_balance_contents_playerdamage_slime * autocvar_g_balance_contents_damagerate * this.waterlevel, DEATH_SLIME.m_id, this.origin, '0 0 0');
+ Damage (this, NULL, NULL, autocvar_g_balance_contents_playerdamage_slime * autocvar_g_balance_contents_damagerate * this.waterlevel, DEATH_SLIME.m_id, this.origin, '0 0 0');
}
}
}
else
dm = min((dm - autocvar_g_balance_falldamage_minspeed) * autocvar_g_balance_falldamage_factor, autocvar_g_balance_falldamage_maxdamage);
if (dm > 0)
- Damage (this, world, world, dm, DEATH_FALL.m_id, this.origin, '0 0 0');
+ Damage (this, NULL, NULL, dm, DEATH_FALL.m_id, this.origin, '0 0 0');
}
if(autocvar_g_maxspeed > 0 && velocity_len > autocvar_g_maxspeed)
- Damage (this, world, world, 100000, DEATH_SHOOTING_STAR.m_id, this.origin, '0 0 0');
+ Damage (this, NULL, NULL, 100000, DEATH_SHOOTING_STAR.m_id, this.origin, '0 0 0');
}
}
{
// create waypoint links for warpzones
entity e;
- for(e = world; (e = find(e, classname, "trigger_warpzone")); )
+ for(e = NULL; (e = find(e, classname, "trigger_warpzone")); )
{
vector src, dst;
src = (e.absmin + e.absmax) * 0.5;
void target_init_verify(entity this)
{
entity trigger, targ;
- for(trigger = world; (trigger = find(trigger, classname, "trigger_multiple")); )
- for(targ = world; (targ = find(targ, targetname, trigger.target)); )
+ for(trigger = NULL; (trigger = find(trigger, classname, "trigger_multiple")); )
+ for(targ = NULL; (targ = find(targ, targetname, trigger.target)); )
if (targ.classname == "target_init" || targ.classname == "target_give" || targ.classname == "target_items")
{
trigger.wait = 0;
void target_give_init(entity this)
{
entity targ;
- for (targ = world; (targ = find(targ, targetname, this.target)); ) {
+ for (targ = NULL; (targ = find(targ, targetname, this.target)); ) {
if (targ.classname == "weapon_rocketlauncher" || targ.classname == "weapon_devastator") {
this.ammo_rockets += targ.count * WEP_CVAR(devastator, ammo);
this.netname = "devastator";
cache_mutatormsg = strzone("");
cache_lastmutatormsg = strzone("");
- InitializeEntity(world, default_delayedinit, INITPRIO_GAMETYPE_FALLBACK);
+ InitializeEntity(NULL, default_delayedinit, INITPRIO_GAMETYPE_FALLBACK);
}
string GetClientVersionMessage(entity this)
// find out what teams are allowed if necessary
if(teament_name)
{
- entity head = find(world, classname, teament_name);
+ entity head = find(NULL, classname, teament_name);
while(head)
{
switch(head.team)
if(ignore_pl)
GetTeamCounts(pl);
else
- GetTeamCounts(world);
+ GetTeamCounts(NULL);
RandomSelection_Init();
// now t is the minimum, or A minimum!
if(t == 1 || TeamSmallerEqThanTeam(1, t, pl))
- RandomSelection_Add(world, 1, string_null, 1, 1);
+ RandomSelection_Add(NULL, 1, string_null, 1, 1);
if(t == 2 || TeamSmallerEqThanTeam(2, t, pl))
- RandomSelection_Add(world, 2, string_null, 1, 1);
+ RandomSelection_Add(NULL, 2, string_null, 1, 1);
if(t == 3 || TeamSmallerEqThanTeam(3, t, pl))
- RandomSelection_Add(world, 3, string_null, 1, 1);
+ RandomSelection_Add(NULL, 3, string_null, 1, 1);
if(t == 4 || TeamSmallerEqThanTeam(4, t, pl))
- RandomSelection_Add(world, 4, string_null, 1, 1);
+ RandomSelection_Add(NULL, 4, string_null, 1, 1);
return RandomSelection_chosen_float;
}
if(!IS_CLIENT(this))
{
// since this is an engine function, and gamecode doesn't have any calls earlier than this, do the connecting message here
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_CONNECTING, this.netname);
+ Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_CONNECTING, this.netname);
return;
}
else // if(source_team == 4)
steam = NUM_TEAM_4;
- lowest_bot = world;
+ lowest_bot = NULL;
lowest_bot_score = 999999999;
- lowest_player = world;
+ lowest_player = NULL;
lowest_player_score = 999999999;
// find the lowest-scoring player & bot of that team
));
// prefers to move a bot...
- if(lowest_bot != world)
+ if(lowest_bot != NULL)
selected = lowest_bot;
// but it will move a player if it has to
else
this.SendFlags |= ISF_LOCATION;
this.oldorigin = this.origin;
}
- this.owner = world;
+ this.owner = NULL;
float timeleft = this.savenextthink - time;
if(timeleft > 1)
SUB_SetFade(this, this.savenextthink - 1, 1);
else
ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
if(antilag)
- WarpZone_traceline_antilag(world, ent.origin + ent.view_ofs, ent.origin + ent.view_ofs + s_forward * range, MOVE_NORMAL, ent, ANTILAG_LATENCY(ent));
- // passing world, because we do NOT want it to touch dphitcontentsmask
+ WarpZone_traceline_antilag(NULL, ent.origin + ent.view_ofs, ent.origin + ent.view_ofs + s_forward * range, MOVE_NORMAL, ent, ANTILAG_LATENCY(ent));
+ // passing NULL, because we do NOT want it to touch dphitcontentsmask
else
WarpZone_TraceLine(ent.origin + ent.view_ofs, ent.origin + ent.view_ofs + s_forward * range, MOVE_NOMONSTERS, ent);
ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
void W_SetupProjVelocity_Explicit(entity proj, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute)
{
- if(proj.owner == world)
+ if(proj.owner == NULL)
error("Unowned missile");
dir = dir + upDir * (pUpSpeed / pSpeed);
entity pseudoprojectile;
float f, ffs;
- pseudoprojectile = world;
+ pseudoprojectile = NULL;
dir = normalize(end - start);
length = vlen(end - start);
WarpZone_traceline_antilag (this, start, end, false, o, ANTILAG_LATENCY(this));
if(o && WarpZone_trace_firstzone)
{
- o = world;
+ o = NULL;
continue;
}
if(trace_ent.solid == SOLID_BSP || trace_ent.solid == SOLID_SLIDEBOX)
Damage_DamageInfo(trace_endpos, bdamage, 0, 0, force, deathtype, trace_ent.species, this);
- // if it is world we can't hurt it so stop now
- if (trace_ent == world || trace_fraction == 1)
+ // if it is NULL we can't hurt it so stop now
+ if (trace_ent == NULL || trace_fraction == 1)
break;
// make the entity non-solid so we can hit the next one
endq3surfaceflags = trace_dphitq3surfaceflags;
// find all the entities the railgun hit and restore their solid state
- ent = findfloat(world, railgunhit, true);
+ ent = findfloat(NULL, railgunhit, true);
while (ent)
{
// restore their solid type
}
// find all the entities the railgun hit and hurt them
- ent = findfloat(world, railgunhit, true);
+ ent = findfloat(NULL, railgunhit, true);
while (ent)
{
// get the details we need to call the damage function
// create a small explosion to throw gibs around (if applicable)
//setorigin(explosion, hitloc);
- //RadiusDamage (explosion, this, 10, 0, 50, world, world, 300, deathtype);
+ //RadiusDamage (explosion, this, 10, 0, 50, NULL, NULL, 300, deathtype);
ent.railgunhitloc = '0 0 0';
ent.railgunhitsolidbackup = SOLID_NOT;
void fireBullet_trace_callback(vector start, vector hit, vector end)
{
if(vdist(hit - start, >, 16))
- trailparticles(world, fireBullet_trace_callback_eff, start, hit);
- WarpZone_trace_forent = world;
- fireBullet_last_hit = world;
+ trailparticles(NULL, fireBullet_trace_callback_eff, start, hit);
+ WarpZone_trace_forent = NULL;
+ fireBullet_last_hit = NULL;
}
void fireBullet(entity this, vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects)
dir = normalize(dir + randomvec() * spread);
end = start + dir * MAX_SHOT_DISTANCE;
- fireBullet_last_hit = world;
+ fireBullet_last_hit = NULL;
float solid_penetration_left = 1;
float total_damage = 0;
for (;;)
{
// TODO also show effect while tracing
- WarpZone_TraceBox_ThroughZone(start, '0 0 0', '0 0 0', end, false, WarpZone_trace_forent, world, fireBullet_trace_callback);
+ WarpZone_TraceBox_ThroughZone(start, '0 0 0', '0 0 0', end, false, WarpZone_trace_forent, NULL, fireBullet_trace_callback);
dir = WarpZone_TransformVelocity(WarpZone_trace_transform, dir);
end = WarpZone_TransformOrigin(WarpZone_trace_transform, end);
start = trace_endpos;
return;
if(autocvar_sv_weaponstats_file != "")
{
- url_multi_fopen(autocvar_sv_weaponstats_file, FILE_APPEND, WeaponStats_ready, world);
+ url_multi_fopen(autocvar_sv_weaponstats_file, FILE_APPEND, WeaponStats_ready, NULL);
}
else
{