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