X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=data%2Fqcsrc%2Fclient%2FMain.qc;h=cea3273d385a5249596a8d362f26e35609e51d1c;hb=2c56e75249796d328ef73cd48fa3dc827c9ed16c;hp=cf29ae8aa8a3d7169f23faff3eb80f7cfe75c203;hpb=cc148bf19700d380a18d7f51a706f9bbe959811b;p=voretournament%2Fvoretournament.git diff --git a/data/qcsrc/client/Main.qc b/data/qcsrc/client/Main.qc index cf29ae8a..cea3273d 100644 --- a/data/qcsrc/client/Main.qc +++ b/data/qcsrc/client/Main.qc @@ -68,7 +68,7 @@ void CSQC_Init(void) ClientProgsDB = db_load("client.db"); compressShortVector_init(); - drawfont = 0; + drawfont = FONT_USER+1; menu_visible = FALSE; menu_show = menu_show_error; menu_action = menu_sub_null; @@ -88,6 +88,8 @@ void CSQC_Init(void) registercmd("-button3"); registercmd("+button4"); registercmd("-button4"); + registercmd("+button6"); + registercmd("-button6"); registercmd("+showaccuracy");registercmd("-showaccuracy"); #ifndef CAMERATEST @@ -116,7 +118,7 @@ void CSQC_Init(void) postinit = false; - calledgrabbers = 0; + calledhooks = 0; teams = Sort_Spawn(); players = Sort_Spawn(); @@ -141,6 +143,9 @@ void CSQC_Init(void) cl_announcer_prev = strzone(cvar_string("cl_announcer")); } + if(cvar("cl_reticle_item_normal")) precache_pic("gfx/reticle_normal"); + if(cvar("cl_reticle_item_nex")) precache_pic("gfx/reticle_nex"); + #ifdef UID { // find the user ID @@ -159,13 +164,13 @@ void CSQC_Init(void) #endif get_mi_min_max_texcoords(1); // try the CLEVER way first - minimapname = strcat("gfx/", mi_shortname, "_radar.tga"); + minimapname = strcat("gfx/radar/", mi_shortname, "_radar.tga"); shortmapname = mi_shortname; if(precache_pic(minimapname) == "") { // but maybe we have a non-clever minimap - minimapname = strcat("gfx/", mi_shortname, "_mini.tga"); + minimapname = strcat("gfx/radar/", mi_shortname, "_mini.tga"); if(precache_pic(minimapname) == "") minimapname = ""; // FAIL else @@ -203,12 +208,24 @@ void CSQC_Shutdown(void) if(camera_active) cvar_set("chase_active",ftos(chase_active_backup)); + // unset the event chasecam's chase_active + if(cvar("chase_active") < 0) + cvar_set("chase_active", "0"); + if not(isdemo()) { - if not(calledgrabbers & GRABBER_START) + if not(calledhooks & HOOK_START) + { localcmd("\n_cl_hook_gamestart nop;"); - if not(calledgrabbers & GRABBER_END) + if(g_campaign) // this is a server cvar used in the client code, but g_campaign is always local, so it should be safe + localcmd("\n_cl_hook_campaign_gamestart nop;"); + } + if not(calledhooks & HOOK_END) + { localcmd("\ncl_hook_gameend;"); + if(g_campaign) + localcmd("\ncl_hook_campaign_gameend;"); + } } } @@ -387,6 +404,12 @@ float CSQC_ConsoleCommand(string strMessage) } else if(strCmd == "-button3") { // secondary button_attack2 = 0; return false; + } else if(strCmd == "+button6") { // secondary + button_jetpack = 1; + return false; + } else if(strCmd == "-button6") { // secondary + button_jetpack = 0; + return false; } else if(strCmd == "+showscores") { sb_showscores = true; return true; @@ -634,17 +657,38 @@ float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary) // -------------------------------------------------------------------------- // BEGIN OPTIONAL CSQC FUNCTIONS +void Ent_RemoveEntCS() +{ + entcs_receiver[self.sv_entnum] = world; +} void Ent_ReadEntCS() { + float sf; InterpolateOrigin_Undo(); self.classname = "entcs_receiver"; - self.sv_entnum = ReadByte() - 1; - self.origin_x = ReadShort(); - self.origin_y = ReadShort(); - self.origin_z = ReadShort(); - self.angles_y = ReadByte() * 360.0 / 256; - self.origin_z = self.angles_x = self.angles_z = 0; + sf = ReadByte(); + + if(sf & 1) + self.sv_entnum = ReadByte(); + if(sf & 2) + { + self.origin_x = ReadShort(); + self.origin_y = ReadShort(); + self.origin_z = ReadShort(); + } + if(sf & 4) + { + self.angles_y = ReadByte() * 360.0 / 256; + self.angles_x = self.angles_z = 0; + } + if(sf & 8) + self.healthvalue = ReadByte() * 10; + if(sf & 16) + self.armorvalue = ReadByte() * 10; + + entcs_receiver[self.sv_entnum] = self; + self.entremove = Ent_RemoveEntCS; InterpolateOrigin_Note(); } @@ -933,22 +977,15 @@ void CSQC_Ent_Remove() void Gamemode_Init() { - if(gametype == GAME_ONSLAUGHT) { + if(gametype == GAME_ONSLAUGHT) print(strcat("Using ", minimapname, " as minimap.\n")); - precache_pic("gfx/ons-cp-neutral.tga"); - precache_pic("gfx/ons-cp-red.tga"); - precache_pic("gfx/ons-cp-blue.tga"); - precache_pic("gfx/ons-frame.tga"); - precache_pic("gfx/ons-frame-team.tga"); - } else if(gametype == GAME_KEYHUNT) { - precache_pic("gfx/sb_key_carrying"); - precache_pic("gfx/sb_key_carrying_outline"); - } if not(isdemo()) { localcmd("\n_cl_hook_gamestart ", GametypeNameFromType(gametype), ";"); - calledgrabbers |= GRABBER_START; + if(g_campaign) + localcmd("\n_cl_hook_campaign_gamestart ", GametypeNameFromType(gametype), ";"); + calledhooks |= HOOK_START; } } // CSQC_Parse_StuffCmd : Provides the stuffcmd string in the first parameter that the server provided. To execute standard behavior, simply execute localcmd with the string. @@ -1010,12 +1047,16 @@ void Ent_Init() strunzone(forcefog); forcefog = strzone(ReadString()); + g_campaign = ReadCoord(); + armorblockpercent = ReadByte() / 255.0; g_weaponswitchdelay = ReadByte() / 255.0; + g_vore = ReadCoord(); g_balance_vore_swallow_limit = ReadCoord(); - g_vore_showpreyhealth = ReadCoord(); + + armor_max = ReadCoord(); if(!postinit) PostInit(); @@ -1211,7 +1252,7 @@ void Net_ReadOtherPLReport() if not(playerslots[e]) return; playerslots[e].plhealth = ph; - playerslots[e].pleater = pn; + playerslots[e].plpredator = pn; } void Net_VoteDialog(float highlight) { @@ -1268,10 +1309,6 @@ float CSQC_Parse_TempEntity() Net_ReadZCurveParticles(); bHandled = true; break; - case TE_CSQC_NEXGUNBEAMPARTICLE: - Net_ReadNexgunBeamParticle(); - bHandled = true; - break; case TE_CSQC_TEAMNAGGER: Net_TeamNagger(); bHandled = true;