1 // --------------------------------------------------------------------------
2 // BEGIN REQUIRED CSQC FUNCTIONS
5 #define DP_CSQC_ENTITY_REMOVE_IS_B0RKED
7 void cvar_clientsettemp(string cv, string val)
10 for(e = world; (e = find(e, classname, "saved_cvar_value")); )
14 e.classname = "saved_cvar_value";
15 e.netname = strzone(cv);
16 e.message = strzone(cvar_string(cv));
21 void cvar_clientsettemp_restore()
24 for(e = world; (e = find(e, classname, "saved_cvar_value")); )
25 cvar_set(e.netname, e.message);
28 void() menu_show_error =
30 drawstring('0 200 0', "ERROR - MENU IS VISIBLE BUT NO MENU WAS DEFINED!", '8 8 0', '1 0 0', 1, 0);
33 // CSQC_Init : Called every time the CSQC code is initialized (essentially at map load)
34 // Useful for precaching things
36 void() menu_sub_null =
45 void WaypointSprite_Load();
50 __engine_check = checkextension("DP_SV_WRITEPICTURE");
53 print("^3Your engine build is outdated\n^3This Server uses a newer QC VM. Please update!\n");
54 localcmd("\ndisconnect\n");
60 check_unacceptable_compiler_bugs();
68 compressShortVector_init();
72 menu_show = menu_show_error;
73 menu_action = menu_sub_null;
75 for(i = 0; i < 255; ++i)
76 if(getplayerkey(i, "viewentity") == "")
81 // localcmd("alias order \"cmd order $*\""); enable if ctf-command thingy is used
82 //registercmd("ctf_menu");
83 registercmd("ons_map");
84 //registercmd("menu_action");
86 registercmd("+button3");
87 registercmd("-button3");
88 registercmd("+button4");
89 registercmd("-button4");
90 registercmd("+showaccuracy");registercmd("-showaccuracy");
96 registercmd("+forward");registercmd("-forward");
97 registercmd("+back");registercmd("-back");
98 registercmd("+moveup");registercmd("-moveup");
99 registercmd("+movedown");registercmd("-movedown");
100 registercmd("+moveright");registercmd("-moveright");
101 registercmd("+moveleft");registercmd("-moveleft");
102 registercmd("+roll_right");registercmd("-roll_right");
103 registercmd("+roll_left");registercmd("-roll_left");
107 registercvar("sbar_usecsqc", "1");
108 registercvar("sbar_columns", "default", CVAR_SAVE);
112 // sbar_fields uses strunzone on the titles!
113 for(i = 0; i < MAX_SBAR_FIELDS; ++i)
114 sbar_title[i] = strzone("(null)");
118 teams = Sort_Spawn();
119 players = Sort_Spawn();
121 GetTeam(COLOR_SPECTATOR, true); // add specs first
123 cvar_clientsettemp("_supports_weaponpriority", "1");
128 cs_project_is_b0rked = TRUE;
129 R_SetView(VF_VIEWPORT, '0 0 0', '640 480 0');
130 R_SetView(VF_FOV, '90 90 0');
131 R_SetView(VF_ORIGIN, '0 0 0');
132 R_SetView(VF_ANGLES, '0 0 0');
133 R_SetView(VF_PERSPECTIVE, 1);
134 makevectors('0 0 0');
136 v = cs_project(v_forward);
141 cs_project_is_b0rked = FALSE;
145 WaypointSprite_Load();
147 Projectile_Precache();
148 GibSplash_Precache();
150 DamageInfo_Precache();
151 Announcer_Precache();
153 get_mi_min_max_texcoords(1); // try the CLEVER way first
154 minimapname = strcat("gfx/", mi_shortname, "_radar.tga");
155 shortmapname = mi_shortname;
157 if(precache_pic(minimapname) == "")
159 // but maybe we have a non-clever minimap
160 minimapname = strcat("gfx/", mi_shortname, "_mini.tga");
161 if(precache_pic(minimapname) == "")
162 minimapname = ""; // FAIL
164 get_mi_min_max_texcoords(0); // load new texcoords
167 mi_center = (mi_min + mi_max) * 0.5;
168 mi_scale = mi_max - mi_min;
169 minimapname = strzone(minimapname);
172 // CSQC_Shutdown : Called every time the CSQC code is shutdown (changing maps, quitting, etc)
173 void CSQC_Shutdown(void)
187 cvar_clientsettemp_restore();
190 cvar_set("chase_active",ftos(chase_active_backup));
194 float SetTeam(entity o, float Team)
197 if(Team == -1) // leave
201 //print("(DISCONNECT) leave team ", ftos(o.team), "\n");
202 tm = GetTeam(o.team, false);
212 //print("(CONNECT) enter team ", ftos(o.team), "\n");
214 tm = GetTeam(Team, true);
219 else if(Team != o.team)
221 //print("(CHANGE) leave team ", ftos(o.team), "\n");
222 tm = GetTeam(o.team, false);
225 //print("(CHANGE) enter team ", ftos(o.team), "\n");
226 tm = GetTeam(Team, true);
234 void Playerchecker_Think()
238 for(i = 0; i < maxclients; ++i)
241 if(GetPlayerName(i) == "")
245 //print("playerchecker: KILL KILL KILL\n");
246 // player disconnected
257 //print("playerchecker: SPAWN SPAWN SPAWN\n");
260 playerslots[i] = e = spawn();
262 //e.gotscores = 0; // we might already have the scores...
263 SetTeam(e, GetPlayerColor(i)); // will not hurt; later updates come with Sbar_UpdatePlayerTeams
265 Sbar_UpdatePlayerPos(e);
269 self.nextthink = time + 0.2;
276 print(strcat("PostInit\n maxclients = ", ftos(maxclients), "\n"));
277 localcmd(strcat("\nsbar_columns_set ", cvar_string("sbar_columns"), ";\n"));
279 entity playerchecker;
280 playerchecker = spawn();
281 playerchecker.think = Playerchecker_Think;
282 playerchecker.nextthink = time + 0.2;
290 // CSQC_ConsoleCommand : Used to parse commands in the console that have been registered with the "registercmd" function
291 // Return value should be 1 if CSQC handled the command, otherwise return 0 to have the engine handle it.
293 void Cmd_Sbar_SetFields(float);
294 void Cmd_Sbar_Help(float);
295 float CSQC_ConsoleCommand(string strMessage)
299 //argc = tokenize(strMessage);
300 argc = tokenize_console(strMessage);
306 if(strCmd == "+button4") { // zoom
307 // return false, because the message shall be sent to the server anyway (for demos/speccing)
315 } else if(strCmd == "-button4") { // zoom
316 if(ignore_minus_zoom)
323 } else if(strCmd == "+button3") { // secondary
326 } else if(strCmd == "-button3") { // secondary
329 } else if(strCmd == "+showscores") {
330 sb_showscores = true;
332 } else if(strCmd == "-showscores") {
333 sb_showscores = false;
335 } else if(strCmd == "+showaccuracy") {
336 sb_showaccuracy = true;
338 } else if(strCmd == "-showaccuracy") {
339 sb_showaccuracy = false;
344 if(strCmd == "+forward" || strCmd == "-back") {
345 ++camera_direction_x;
347 } else if(strCmd == "-forward" || strCmd == "+back") {
348 --camera_direction_x;
350 } else if(strCmd == "+moveright" || strCmd == "-moveleft") {
351 --camera_direction_y;
353 } else if(strCmd == "-moveright" || strCmd == "+moveleft") {
354 ++camera_direction_y;
356 } else if(strCmd == "+moveup" || strCmd == "-movedown") {
357 ++camera_direction_z;
359 } else if(strCmd == "-moveup" || strCmd == "+movedown") {
360 --camera_direction_z;
362 } else if(strCmd == "+roll_right" || strCmd == "-roll_left") {
365 } else if(strCmd == "+roll_left" || strCmd == "-roll_right") {
374 entity debug_shotorg;
377 self.origin = view_origin + view_forward * self.view_ofs_x + view_right * self.view_ofs_y + view_up * self.view_ofs_z;
378 self.angles = view_angles;
379 self.angles_x = -self.angles_x;
383 void ShotOrg_Draw2D()
385 vector coord2d_topleft, coord2d_topright, coord2d;
389 s = vtos(self.view_ofs);
390 s = substring(s, 1, strlen(s) - 2);
391 if(tokenize_console(s) == 3)
392 s = strcat(argv(0), " ", argv(1), " ", argv(2));
394 coord2d_topleft = project_3d_to_2d(self.origin + view_up * 4 - view_right * 4);
395 coord2d_topright = project_3d_to_2d(self.origin + view_up * 4 + view_right * 4);
397 fs = '1 1 0' * ((coord2d_topright_x - coord2d_topleft_x) / stringwidth(s, FALSE));
399 coord2d = coord2d_topleft;
402 coord2d_x += (coord2d_topright_x - coord2d_topleft_x) * (1 - 8 / fs_x) * 0.5;
407 drawstring(coord2d, s, fs, '1 1 1', 1, 0);
412 debug_shotorg = spawn();
413 debug_shotorg.draw = ShotOrg_Draw;
414 debug_shotorg.draw2d = ShotOrg_Draw2D;
415 debug_shotorg.renderflags = RF_VIEWMODEL;
416 debug_shotorg.effects = EF_FULLBRIGHT;
417 precache_model("models/shotorg_adjuster.md3");
418 setmodel(debug_shotorg, "models/shotorg_adjuster.md3");
419 debug_shotorg.scale = 2;
420 debug_shotorg.view_ofs = '25 8 -8';
423 void GameCommand(string msg)
426 argc = tokenize_console(msg);
428 if(argv(0) == "help" || argc == 0)
430 print("Usage: cl_cmd COMMAND..., where possible commands are:\n");
431 print(" settemp cvar value\n");
433 print(" sbar_columns_set ...\n");
434 print(" sbar_columns_help\n");
435 GameCommand_Generic("help");
439 if(GameCommand_Generic(msg))
444 if(cmd == "mv_download") {
445 Cmd_MapVote_MapDownload(argc);
447 else if(cmd == "settemp") {
448 cvar_clientsettemp(argv(1), argv(2));
450 else if(cmd == "radar") {
451 ons_showmap = !ons_showmap;
453 else if(cmd == "sbar_columns_set") {
454 Cmd_Sbar_SetFields(argc);
456 else if(cmd == "sbar_columns_help") {
460 else if(cmd == "blurtest") {
461 blurtest_time0 = time;
462 blurtest_time1 = time + stof(argv(1));
463 blurtest_radius = stof(argv(2));
464 blurtest_power = stof(argv(3));
467 else if(cmd == "shotorg_move") {
471 debug_shotorg.view_ofs = debug_shotorg.view_ofs + stov(argv(1));
472 localcmd("sv_cmd debug_shotorg \"", vtos(debug_shotorg.view_ofs), "\"\n");
474 else if(cmd == "shotorg_movez") {
478 debug_shotorg.view_ofs = debug_shotorg.view_ofs + stof(argv(1)) * (debug_shotorg.view_ofs * (1 / debug_shotorg.view_ofs_x)); // closer/farther, same xy pos
479 localcmd("sv_cmd debug_shotorg \"", vtos(debug_shotorg.view_ofs), "\"\n");
481 else if(cmd == "shotorg_set") {
485 debug_shotorg.view_ofs = stov(argv(1));
486 localcmd("sv_cmd debug_shotorg \"", vtos(debug_shotorg.view_ofs), "\"\n");
488 else if(cmd == "shotorg_setz") {
492 debug_shotorg.view_ofs = debug_shotorg.view_ofs * (stof(argv(1)) / debug_shotorg.view_ofs_x); // closer/farther, same xy pos
493 localcmd("sv_cmd debug_shotorg \"", vtos(debug_shotorg.view_ofs), "\"\n");
495 else if(cmd == "shotorg_toggle_hide") {
498 debug_shotorg.cnt = !debug_shotorg.cnt;
501 else if(cmd == "shotorg_end") {
504 print(vtos(debug_shotorg.view_ofs), "\n");
505 remove(debug_shotorg);
506 debug_shotorg = world;
508 localcmd("sv_cmd debug_shotorg\n");
512 print("Invalid command. For a list of supported commands, try cl_cmd help.\n");
518 // CSQC_InputEvent : Used to perform actions based on any key pressed, key released and mouse on the client.
519 // Return value should be 1 if CSQC handled the input, otherwise return 0 to have the input passed to the engine.
520 // All keys are in ascii.
521 // bInputType = 0 is key pressed, 1 is key released, 2 is mouse input.
522 // In the case of keyboard input, nPrimary is the ascii code, and nSecondary is 0.
523 // In the case of mouse input, nPrimary is xdelta, nSecondary is ydelta.
524 float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
526 local float bSkipKey;
530 if(menu_action(bInputType, nPrimary, nSecondary))
535 // END REQUIRED CSQC FUNCTIONS
536 // --------------------------------------------------------------------------
538 // --------------------------------------------------------------------------
539 // BEGIN OPTIONAL CSQC FUNCTIONS
542 InterpolateOrigin_Undo();
544 self.classname = "entcs_receiver";
545 self.sv_entnum = ReadByte() - 1;
546 self.origin_x = ReadShort();
547 self.origin_y = ReadShort();
548 self.origin_z = ReadShort();
549 self.angles_y = ReadByte() * 360.0 / 256;
550 self.origin_z = self.angles_x = self.angles_z = 0;
552 InterpolateOrigin_Note();
557 void Ent_RemovePlayerScore()
563 SetTeam(self.owner, -1);
564 self.owner.gotscores = 0;
565 for(i = 0; i < MAX_SCORE; ++i)
566 self.owner.(scores[i]) = 0; // clear all scores
570 void Ent_ReadPlayerScore()
576 // damnit -.- don't want to go change every single .sv_entnum in sbar.qc AGAIN
577 // (no I've never heard of M-x replace-string, sed, or anything like that)
578 isNew = !self.owner; // workaround for DP bug
581 #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED
582 if(!isNew && n != self.sv_entnum)
584 print("A CSQC entity changed its owner!\n");
587 self.enttype = ENT_CLIENT_SCORES;
593 if not(playerslots[self.sv_entnum])
594 playerslots[self.sv_entnum] = spawn();
595 o = self.owner = playerslots[self.sv_entnum];
596 o.sv_entnum = self.sv_entnum;
599 //if not(o.sort_prev)
600 // RegisterPlayer(o);
601 //playerchecker will do this for us later, if it has not already done so
604 for(i = 0; i < MAX_SCORE; ++i)
605 o.(scores[i]) = ReadShort();
614 for(i = 0, p = 1; i < MAX_SCORE; ++i, p *= 2)
616 o.(scores[i]) = ReadShort();
620 Sbar_UpdatePlayerPos(o); // if not registered, we cannot do this yet!
622 self.entremove = Ent_RemovePlayerScore;
625 void Ent_ReadTeamScore()
630 self.team = ReadByte();
631 o = self.owner = GetTeam(self.team, true);
633 #if MAX_TEAMSCORE <= 3
634 for(i = 0; i < MAX_TEAMSCORE; ++i)
635 o.(teamscores[i]) = ReadShort();
638 #if MAX_TEAMSCORE <= 8
644 for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
646 o.(teamscores[i]) = ReadShort();
649 Sbar_UpdateTeamPos(o);
656 void Ent_ClientData()
659 float newspectatee_status;
663 sb_showscores_force = (f & 1);
667 newspectatee_status = ReadByte();
668 if(newspectatee_status == player_localentnum)
669 newspectatee_status = -1; // observing
672 newspectatee_status = 0;
674 spectatorbutton_zoom = (f & 4);
678 angles_held_status = 1;
679 angles_held_x = ReadAngle();
680 angles_held_y = ReadAngle();
684 angles_held_status = 0;
686 if(newspectatee_status != spectatee_status)
690 race_checkpointtime = 0;
692 spectatee_status = newspectatee_status;
697 float nags, i, j, b, f;
704 strunzone(vote_called_vote);
705 vote_called_vote = strzone(ColorTranslateRGB(ReadString()));
710 for(j = 0; j < maxclients; ++j)
712 playerslots[j].ready = 1;
713 for(i = 1; i <= maxclients; i += 8)
716 for(j = i-1, b = 1; b < 256; b *= 2, ++j)
719 playerslots[j].ready = 0;
723 ready_waiting = (nags & 1);
724 ready_waiting_for_me = (nags & 2);
725 vote_waiting = (nags & 4);
726 vote_waiting_for_me = (nags & 8);
727 warmup_stage = (nags & 16);
730 void Ent_RandomSeed()
738 // CSQC_Ent_Update : Called every frame that the server has indicated an update to the SSQC / CSQC entity has occured.
739 // The only parameter reflects if the entity is "new" to the client, meaning it just came into the client's PVS.
740 void Ent_RadarLink();
742 void Ent_ScoresInfo();
743 void(float bIsNewEntity) CSQC_Ent_Update =
749 // set up the "time" global for received entities to be correct for interpolation purposes
757 serverprevtime = time;
758 serverdeltatime = getstatf(STAT_MOVEVARS_TICRATE) * getstatf(STAT_MOVEVARS_TIMESCALE);
759 time = serverprevtime + serverdeltatime;
762 #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED
764 if(t != self.enttype)
766 print("A CSQC entity changed its type!\n");
773 case ENT_CLIENT_ENTCS: Ent_ReadEntCS(); break;
774 case ENT_CLIENT_SCORES: Ent_ReadPlayerScore(); break;
775 case ENT_CLIENT_TEAMSCORES: Ent_ReadTeamScore(); break;
776 case ENT_CLIENT_POINTPARTICLES: Ent_PointParticles(); break;
777 case ENT_CLIENT_RAINSNOW: Ent_RainOrSnow(); break;
778 case ENT_CLIENT_LASER: Ent_Laser(); break;
779 case ENT_CLIENT_NAGGER: Ent_Nagger(); break;
780 case ENT_CLIENT_WAYPOINT: Ent_WaypointSprite(); break;
781 case ENT_CLIENT_RADARLINK: Ent_RadarLink(); break;
782 case ENT_CLIENT_PROJECTILE: Ent_Projectile(); break;
783 case ENT_CLIENT_GIBSPLASH: Ent_GibSplash(); break;
784 case ENT_CLIENT_DAMAGEINFO: Ent_DamageInfo(); break;
785 case ENT_CLIENT_CASING: Ent_Casing(); break;
786 case ENT_CLIENT_INIT: Ent_Init(); break;
787 case ENT_CLIENT_SCORES_INFO: Ent_ScoresInfo(); break;
788 case ENT_CLIENT_MAPVOTE: Ent_MapVote(); break;
789 case ENT_CLIENT_CLIENTDATA: Ent_ClientData(); break;
790 case ENT_CLIENT_RANDOMSEED: Ent_RandomSeed(); break;
791 case ENT_CLIENT_WALL: Ent_Wall(); break;
793 error(strcat("unknown entity type in CSQC_Ent_Update: ", ftos(self.enttype), "\n"));
799 // Destructor, but does NOT deallocate the entity by calling remove(). Also
800 // used when an entity changes its type. For an entity that someone interacts
801 // with others, make sure it can no longer do so.
809 self.draw = menu_sub_null;
810 self.entremove = menu_sub_null;
811 // TODO possibly set more stuff to defaults
813 // CSQC_Ent_Remove : Called when the server requests a SSQC / CSQC entity to be removed. Essentially call remove(self) as well.
814 void CSQC_Ent_Remove()
823 if(gametype == GAME_ONSLAUGHT) {
824 print(strcat("Using ", minimapname, " as minimap.\n"));
825 precache_pic("gfx/ons-cp-neutral.tga");
826 precache_pic("gfx/ons-cp-red.tga");
827 precache_pic("gfx/ons-cp-blue.tga");
828 precache_pic("gfx/ons-frame.tga");
829 precache_pic("gfx/ons-frame-team.tga");
830 } else if(gametype == GAME_KEYHUNT) {
831 precache_pic("gfx/sb_key_carrying");
832 precache_pic("gfx/sb_key_carrying_outline");
835 // 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.
836 void CSQC_Parse_StuffCmd(string strMessage)
838 localcmd(strMessage);
840 // CSQC_Parse_Print : Provides the print string in the first parameter that the server provided. To execute standard behavior, simply execute print with the string.
841 void CSQC_Parse_Print(string strMessage)
843 print(ColorTranslateRGB(strMessage));
846 // CSQC_Parse_CenterPrint : Provides the centerprint string in the first parameter that the server provided.
847 void CSQC_Parse_CenterPrint(string strMessage)
849 centerprint(strMessage);
854 // TODO somehow thwart prvm_globalset client ...
857 localcmd(strcat("\nfog ", forcefog, "\nr_fog_exp2 0\nr_drawfog 1\n"));
860 void Gamemode_Init();
861 void Ent_ScoresInfo()
864 self.classname = "ent_client_scores_info";
865 gametype = ReadByte();
866 for(i = 0; i < MAX_SCORE; ++i)
868 scores_label[i] = strzone(ReadString());
869 scores_flags[i] = ReadByte();
871 for(i = 0; i < MAX_TEAMSCORE; ++i)
873 teamscores_label[i] = strzone(ReadString());
874 teamscores_flags[i] = ReadByte();
883 self.classname = "ent_client_init";
885 nb_pb_period = ReadByte() / 32; //Accuracy of 1/32th
887 for(i = 0; i < 24; ++i)
888 weaponimpulse[i] = ReadByte() - 1;
889 hook_shotorigin_x = ReadCoord();
890 hook_shotorigin_y = ReadCoord();
891 hook_shotorigin_z = ReadCoord();
895 forcefog = strzone(ReadString());
897 armorblockpercent = ReadByte() / 255.0;
911 case RACE_NET_CHECKPOINT_HIT_QUALIFYING:
912 race_checkpoint = ReadByte();
913 race_time = ReadShort();
914 race_previousbesttime = ReadShort();
915 if(race_previousbestname)
916 strunzone(race_previousbestname);
917 race_previousbestname = strzone(ColorTranslateRGB(ReadString()));
919 race_checkpointtime = time;
921 if(race_checkpoint == 0 || race_checkpoint == 254)
923 race_penaltyaccumulator = 0;
924 race_laptime = time; // valid
929 case RACE_NET_CHECKPOINT_CLEAR:
931 race_checkpointtime = 0;
934 case RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING:
935 race_laptime = ReadCoord();
936 race_checkpointtime = -99999;
938 case RACE_NET_CHECKPOINT_NEXT_QUALIFYING:
939 race_nextcheckpoint = ReadByte();
941 race_nextbesttime = ReadShort();
942 if(race_nextbestname)
943 strunzone(race_nextbestname);
944 race_nextbestname = strzone(ColorTranslateRGB(ReadString()));
947 case RACE_NET_CHECKPOINT_HIT_RACE:
948 race_mycheckpoint = ReadByte();
949 race_mycheckpointtime = time;
950 race_mycheckpointdelta = ReadShort();
951 race_mycheckpointlapsdelta = ReadByte();
952 if(race_mycheckpointlapsdelta >= 128)
953 race_mycheckpointlapsdelta -= 256;
954 if(race_mycheckpointenemy)
955 strunzone(race_mycheckpointenemy);
956 race_mycheckpointenemy = strzone(ColorTranslateRGB(ReadString()));
959 case RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT:
960 race_othercheckpoint = ReadByte();
961 race_othercheckpointtime = time;
962 race_othercheckpointdelta = ReadShort();
963 race_othercheckpointlapsdelta = ReadByte();
964 if(race_othercheckpointlapsdelta >= 128)
965 race_othercheckpointlapsdelta -= 256;
966 if(race_othercheckpointenemy)
967 strunzone(race_othercheckpointenemy);
968 race_othercheckpointenemy = strzone(ColorTranslateRGB(ReadString()));
971 case RACE_NET_PENALTY_RACE:
972 race_penaltyeventtime = time;
973 race_penaltytime = ReadByte();
974 //race_penaltyaccumulator += race_penaltytime;
975 if(race_penaltyreason)
976 strunzone(race_penaltyreason);
977 race_penaltyreason = strzone(ReadString());
980 case RACE_NET_PENALTY_QUALIFYING:
981 race_penaltyeventtime = time;
982 race_penaltytime = ReadByte();
983 race_penaltyaccumulator += race_penaltytime;
984 if(race_penaltyreason)
985 strunzone(race_penaltyreason);
986 race_penaltyreason = strzone(ReadString());
994 current_viewzoom = 0.6;
997 // CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer.
998 // You must ALWAYS first acquire the temporary ID, which is sent as a byte.
999 // Return value should be 1 if CSQC handled the temporary entity, otherwise return 0 to have the engine process the event.
1000 float CSQC_Parse_TempEntity()
1002 local float bHandled;
1008 // NOTE: Could just do return instead of break...
1011 case TE_CSQC_PICTURE:
1012 Net_MapVote_Picture();
1020 Net_GrapplingHook();
1027 case TE_CSQC_ZCURVEPARTICLES:
1028 Net_ReadZCurveParticles();
1031 case TE_CSQC_NEXGUNBEAMPARTICLE:
1032 Net_ReadNexgunBeamParticle();
1035 case TE_CSQC_LIGHTNINGARC:
1036 Net_ReadLightningarc();
1040 // No special logic for this temporary entity; return 0 so the engine can handle it
1048 string getcommandkey(string text, string command)
1053 if (!sbar_showbinds)
1056 keys = db_get(binddb, command);
1059 n = tokenize(findkeysforcommand(command)); // uses '...' strings
1060 for(j = 0; j < n; ++j)
1066 keys = keynumtostring(k);
1068 keys = strcat(keys, ", ", keynumtostring(k));
1071 if (sbar_showbinds_limit > 0 && sbar_showbinds_limit >= l) break;
1075 db_put(binddb, command, keys);
1079 if (sbar_showbinds > 1)
1080 return strcat(text, " (not bound)");
1084 else if (sbar_showbinds > 1)
1085 return strcat(text, " (", keys, ")");