int centerprint_countdown_num[CENTERPRINT_MAX_MSGS];
bool centerprint_showing;
-<<<<<<< HEAD
float centerprint_medal_expire_time;
string centerprint_medal_icon;
float centerprint_medal_times;
centerprint_showing = true;
}
-=======
->>>>>>> master
void centerprint_Add(int new_id, string strMessage, float duration, int countdown_num)
{
TC(int, new_id); TC(int, countdown_num);
all_messages_expired = false;
// fade
-<<<<<<< HEAD
//if(centerprint_time[j] < 0) // Expired but forced. Expire time is the fade-in time.
// a = (time - centerprint_expire_time[j]) / max(0.0001, autocvar_hud_panel_centerprint_fade_in);
if(centerprint_time[j] < 0 || centerprint_expire_time[j] - autocvar_hud_panel_centerprint_fade_out > time) // Regularily printed. Not fading out yet.
a = 1;
-=======
- if(centerprint_time[j] < 0) // Expired but forced. Expire time is the fade-in time.
- a = (time - centerprint_expire_time[j]) / max(0.0001, autocvar_hud_panel_centerprint_fade_in);
- else if(centerprint_expire_time[j] - autocvar_hud_panel_centerprint_fade_out > time) // Regularily printed. Not fading out yet.
- a = (time - (centerprint_expire_time[j] - centerprint_time[j])) / max(0.0001, autocvar_hud_panel_centerprint_fade_in);
->>>>>>> master
else // Expiring soon, so fade it out.
a = (centerprint_expire_time[j] - time) / max(0.0001, autocvar_hud_panel_centerprint_fade_out);
vector Scoreboard_ItemStats_Draw(vector pos, vector rgb, vector bg_size)
{
+ Inventory g_inventory = inventoryslots[current_player];
scoreboard_itemstats_fade_alpha = min(scoreboard_fade_alpha, scoreboard_itemstats_fade_alpha + frametime * 10);
int disowned_cnt = 0;
bool have_item_stats;
bool Scoreboard_ItemStats_WouldDraw(float ypos)
{
+ Inventory g_inventory = inventoryslots[current_player];
+
if (MUTATOR_CALLHOOK(DrawScoreboardItemStats))
return false;
if (!autocvar_hud_panel_scoreboard_itemstats || !g_inventory || warmup_stage || ypos > 0.91 * vid_conheight)
}
else if (vdist(this.origin - view_origin, >=, max_shot_distance))
return;
-<<<<<<< HEAD
- if (!a) return;
-=======
if (!a || o.z < 0) return;
o.z = 0;
->>>>>>> master
float resize = 1;
if (autocvar_hud_shownames_resize && vdist(this.origin - view_origin, >=, autocvar_hud_shownames_mindistance))
{
-<<<<<<< HEAD
- if (vdist(this.origin - view_origin, >=, autocvar_hud_shownames_mindistance))
- {
- float f = autocvar_hud_shownames_maxdistance - autocvar_hud_shownames_mindistance;
- if (dist == -1)
- dist = vlen(this.origin - view_origin);
- resize = 0.5 + 0.5 * (f - max(0, dist - autocvar_hud_shownames_mindistance)) / f;
- }
-=======
// limit resize so its never smaller than 0.5... gets unreadable
float f = autocvar_hud_shownames_maxdistance - autocvar_hud_shownames_mindistance;
if (dist == -1)
dist = vlen(this.origin - view_origin);
resize = 0.5 + 0.5 * (f - max(0, dist - autocvar_hud_shownames_mindistance)) / f;
->>>>>>> master
}
vector mySize = (vec2(autocvar_hud_shownames_aspect, 1)) * autocvar_hud_shownames_fontsize;
vector myPos = o - vec2(0.5 * mySize.x, mySize.y);
float namewidth = mySize.x;
if (autocvar_hud_shownames_status && this.sameteam && !this.csqcmodel_isdead)
{
-<<<<<<< HEAD
- o.z = 0;
- vector mySize = (vec2(autocvar_hud_shownames_aspect, 1)) * autocvar_hud_shownames_fontsize;
- vector myPos = o - vec2(0.5 * mySize.x, mySize.y);
- // size scaling
- mySize.x *= resize;
- mySize.y *= resize;
- myPos.x += 0.5 * (mySize.x / resize - mySize.x);
- myPos.y += (mySize.y / resize - mySize.y);
- // this is where the origin of the string
- float namewidth = mySize.x;
- if (autocvar_hud_shownames_status && this.sameteam && !this.csqcmodel_isdead)
- {
- vector pos = myPos + eY * autocvar_hud_shownames_fontsize * resize;
- vector sz = vec2(0.5 * mySize.x, resize * autocvar_hud_shownames_statusbar_height);
- if (autocvar_hud_shownames_statusbar_highlight)
- drawfill(pos + eX * 0.25 * mySize.x, sz, '0.7 0.7 0.7', a / 2, DRAWFLAG_NORMAL);
- if (this.healthvalue > 0)
- {
- HUD_Panel_DrawProgressBar(pos, sz, "nametag_statusbar",
- this.healthvalue / autocvar_hud_panel_healtharmor_maxhealth, false, 1, '1 0 0', a,
- DRAWFLAG_NORMAL);
- }
- if (GetResource(this, RES_ARMOR) > 0)
- {
- HUD_Panel_DrawProgressBar(pos + eX * 0.5 * mySize.x, sz, "nametag_statusbar",
- GetResource(this, RES_ARMOR) / autocvar_hud_panel_healtharmor_maxarmor, false, 0, '0 1 0', a,
- DRAWFLAG_NORMAL);
- }
- }
- string s = entcs_GetName(this.sv_entnum - 1);
- if ((autocvar_hud_shownames_decolorize == 1 && teamplay) || autocvar_hud_shownames_decolorize == 2)
- s = playername(s, entcs_GetTeam(this.sv_entnum - 1), true);
- drawfontscale = '1 1 0' * resize;
- s = textShortenToWidth(s, namewidth, '1 1 0' * autocvar_hud_shownames_fontsize, stringwidth_colors);
- float width = stringwidth(s, true, '1 1 0' * autocvar_hud_shownames_fontsize);
- myPos.x = o.x - (width * resize) / 2;
- drawcolorcodedstring(myPos, s, '1 1 0' * autocvar_hud_shownames_fontsize, a, DRAWFLAG_NORMAL);
- drawfontscale = '1 1 0';
-=======
vector pos = myPos + eY * autocvar_hud_shownames_fontsize * resize;
vector sz = vec2(0.5 * mySize.x, resize * autocvar_hud_shownames_statusbar_height);
GetResource(this, RES_ARMOR) / autocvar_hud_panel_healtharmor_maxarmor, false, 0, '0 1 0', a,
DRAWFLAG_NORMAL);
}
->>>>>>> master
}
// antioverlap debug code
//else drawfill(this.box_org - this.box_ofs, this.box_ofs * 2, '1 1 1', a / 2, DRAWFLAG_NORMAL);
LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
case CMD_REQUEST_USAGE:
{
-<<<<<<< HEAD
- LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " maplist action [map]");
- LOG_HELP(" Where 'action' is the command to complete,");
- LOG_HELP(" and 'map' is what it acts upon (if required).");
- LOG_HELP(" Full list of commands here: \"add, cleanup, remove, shuffle.\"");
-=======
LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " maplist <action> [<map>]");
LOG_HELP(" Where <action> is the command to complete,");
LOG_HELP(" and <map> is what it acts upon (for the 'add' and 'remove' actions).");
LOG_HELP(" Full list of commands here: add, cleanup, remove, shuffle.");
->>>>>>> master
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
-<<<<<<< HEAD
- LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " nextframe command...");
- LOG_HELP(" Where command will be executed next frame of this VM");
-=======
LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " nextframe <command>");
LOG_HELP(" Where <command> will be executed next frame of this VM");
->>>>>>> master
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
-<<<<<<< HEAD
- LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " [function to run]");
-=======
LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " <function>");
->>>>>>> master
return;
}
}
{
entity player = M_ARGV(0, entity);
-<<<<<<< HEAD
- if(CS_CVAR(player).cvar_cl_allow_uidtracking == 1 && CS_CVAR(player).cvar_cl_allow_uid2name == 1)
- {
- if (!player.stored_netname)
- player.stored_netname = strzone(uid2name(player.crypto_idfp));
- if(player.stored_netname != player.netname)
- {
- db_put(ServerProgsDB, strcat("/uid2name/", player.crypto_idfp), player.netname);
- strcpy(player.stored_netname, player.netname);
- }
- }
-
- if (!IS_OBSERVER(player))
- {
- if(vdist(player.velocity - player.velocity_z * '0 0 1', >, speedaward_speed))
- {
- speedaward_speed = vlen(player.velocity - player.velocity_z * '0 0 1');
- speedaward_holder = player.netname;
- speedaward_uid = player.crypto_idfp;
- speedaward_lastupdate = time;
- }
- if (speedaward_speed > speedaward_lastsent && time - speedaward_lastupdate > 1)
- {
- string rr = CTS_RECORD;
- race_send_speedaward(MSG_ALL);
- speedaward_lastsent = speedaward_speed;
- if (speedaward_speed > speedaward_alltimebest && speedaward_uid != "")
- {
- speedaward_alltimebest = speedaward_speed;
- speedaward_alltimebest_holder = speedaward_holder;
- speedaward_alltimebest_uid = speedaward_uid;
- db_put(ServerProgsDB, strcat(GetMapname(), rr, "speed/speed"), ftos(speedaward_alltimebest));
- db_put(ServerProgsDB, strcat(GetMapname(), rr, "speed/crypto_idfp"), speedaward_alltimebest_uid);
- race_send_speedaward_alltimebest(MSG_ALL);
- }
- }
- }
-=======
race_checkAndWriteName(player);
race_SpeedAwardFrame(player);
->>>>>>> master
}
MUTATOR_HOOKFUNCTION(cts, ForbidThrowCurrentWeapon)
Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_FREEZETAG_REVIVED, revivers_first.netname);
Send_Notification(NOTIF_ONE, revivers_first, MSG_CENTER, CENTER_FREEZETAG_REVIVE, player.netname);
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED, player.netname, revivers_first.netname);
- Give_Medal(first, ASSIST);
+ Give_Medal(revivers_first, ASSIST);
if(autocvar_sv_eventlog)
{
string revivers = "";
void Inventory_remove(entity this)
{
- if(g_inventory == this)
- g_inventory = NULL;
+ // TODO z411
+ //if(g_inventory == this)
+ // g_inventory = NULL;
}
NET_HANDLE(ENT_CLIENT_INVENTORY, bool isnew)
{
make_pure(this);
//g_inventory = this;
- this.entremove = Inventory_remove;
+ //this.entremove = Inventory_remove;
float entnum = ReadByte() - 1;
inventoryslots[entnum] = this;
void Inventory_delete(entity e) { delete(e.inventory); }
void Inventory_update(entity e) { e.inventory.SendFlags = 0xFFFFFF; }
+void Inventory_clear(entity store)
+{
+ // NOTE: you will need to perform Inventory_update after this to update the storage entity
+ // (unless store is the storage entity)
+ FOREACH(Items, true, {
+ .int fld = inv_items[it.m_id];
+ store.(fld) = 0;
+ });
+}
+
void InventoryStorage_attach(entity e) { e.inventory_store = NEW(Inventory); e.inventory_store.drawonlytoclient = e; }
-void InventoryStorage_detach(entity e) { delete(e.inventory_store); }
+void InventoryStorage_delete(entity e) { delete(e.inventory_store); }
void Inventory_ClearAll() {
- FOREACH_CLIENT(IS_PLAYER(it), {
- entity store = PS(it);
- FOREACH(Items, true, {
- store.inventory.inv_items[it.m_id] = 0;
- });
- Inventory_update(store);
+ FOREACH_CLIENT(IS_PLAYER(it),
+ {
+ entity store = PS(it);
+ if (store)
+ {
+ Inventory_clear(store.inventory);
+ Inventory_update(store);
+ }
});
}
#endif
default:
case CMD_REQUEST_USAGE:
{
-<<<<<<< HEAD
- LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [filename]");
- LOG_HELP(" Where 'filename' is the file to write (default is notifications_dump.cfg),");
-=======
LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [<filename>]");
LOG_HELPF(" Where <filename> is the file to write (default is %s),", DEFAULT_FILENAME);
->>>>>>> master
LOG_HELP(" if supplied with '-' output to console as well as default,");
LOG_HELP(" if left blank, it will only write to default.");
return;
return it;
}
-<<<<<<< HEAD
#define MSG_ANNCE_NOTIF_TEAM(teamnum, name, cvarname, defaultvalue, sound, channel, volume, position, queuetime) \
MSG_ANNCE_NOTIF_(teamnum, ANNCE_##name, ANNCE_##cvarname, defaultvalue, sound, channel, volume, position, queuetime)
#define MSG_ANNCE_NOTIF(name, defaultvalue, sound, channel, volume, position, queuetime) \
-=======
-#define MSG_ANNCE_NOTIF_TEAM(teamnum, name, cvarname, defaultvalue, sound, channel, volume, position) \
- MSG_ANNCE_NOTIF_(teamnum, ANNCE_##name, ANNCE_##cvarname, defaultvalue, sound, channel, volume, position)
-
-#define MSG_ANNCE_NOTIF(name, defaultvalue, sound, channel, volume, position) \
->>>>>>> master
NOTIF_ADD_AUTOCVAR(ANNCE_##name, defaultvalue) \
MSG_ANNCE_NOTIF_(0, ANNCE_##name, ANNCE_##name, defaultvalue, sound, channel, volume, position, queuetime)
void Inventory_new(PlayerState this);
void Inventory_delete(entity this);
void Inventory_clear(PlayerState this);
+//void Inventory_ClearAll();
void InventoryStorage_attach(PlayerState this);
void InventoryStorage_delete(PlayerState this);
PlayerState ps = PS(this);
if (!ps) return; // initial connect
PS(this) = NULL;
- Inventory_clear(this.inventory_store); // no need to network updates, as there is no inventory attached
+ //Inventory_clear(this.inventory_store); // no need to network updates, as there is no inventory attached
if (ps.m_client != this) return; // don't own state, spectator
ps.ps_push(ps, this);
default:
case CMD_REQUEST_USAGE:
{
-<<<<<<< HEAD
- LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpturrets [filename]");
- LOG_HELP(" Where 'filename' is the file to write (default is turrets_dump.cfg),");
-=======
LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpturrets [<filename>]");
LOG_HELPF(" Where <filename> is the file to write (default is %s),", DEFAULT_FILENAME);
->>>>>>> master
LOG_HELP(" if supplied with '-' output to console as well as default,");
LOG_HELP(" if left blank, it will only write to default.");
return;
default:
case CMD_REQUEST_USAGE:
{
-<<<<<<< HEAD
- LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpweapons [filename]");
- LOG_HELP(" Where 'filename' is the file to write (default is weapons_dump.cfg),");
-=======
LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpweapons [<filename>]");
LOG_HELPF(" Where <filename> is the file to write (default is %s),", DEFAULT_FILENAME);
->>>>>>> master
LOG_HELP(" if supplied with '-' output to console as well as default,");
LOG_HELP(" if left blank, it will only write to default.");
return;
METHOD(Vortex, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
if(!WEP_CVAR(vortex, charge_always))
-<<<<<<< HEAD
- W_Vortex_Charge(actor, weaponentity, frametime);
-=======
W_Vortex_Charge(actor, weaponentity, frametime / W_TICSPERFRAME);
->>>>>>> master
if(WEP_CVAR_SEC(vortex, chargepool))
if(actor.(weaponentity).vortex_chargepool_ammo < 1)
PERSON(Freddy) \
PERSON(Halogene) \
PERSON(Jan "zykure" Behrens) \
-// PERSON(Morosophos) \
+ PERSON(Morosophos) \
PERSON(MrBougo) \
PERSON(nilyt/nyov) \
PERSON(Nitroxis) \
// Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
SERVER_COMMAND(setflag, "Set client flag") { GameCommand_setflag(request, arguments); }
SERVER_COMMAND(teamname, "Set team name") { GameCommand_teamname(request, arguments); }
-SERVER_COMMAND(stop, "Stop") { GameCommand_stop(request, arguments); }
SERVER_COMMAND(adminmsg, "Send an admin message to a client directly") { GameCommand_adminmsg(request, arguments); }
SERVER_COMMAND(allready, "Restart the server and reset the players") { GameCommand_allready(request); }
// Otherwise scores could be manipulated during the countdown.
if (!sv_ready_restart_after_countdown) {
Score_ClearAll();
- Inventory_ClearAll();
+ //Inventory_ClearAll();
}
ReadyRestart_force();
}