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");
127 WaypointSprite_Load();
129 Projectile_Precache();
130 GibSplash_Precache();
132 DamageInfo_Precache();
133 Announcer_Precache();
135 get_mi_min_max_texcoords(1); // try the CLEVER way first
136 minimapname = strcat("gfx/", mi_shortname, "_radar.tga");
137 shortmapname = mi_shortname;
139 if(precache_pic(minimapname) == "")
141 // but maybe we have a non-clever minimap
142 minimapname = strcat("gfx/", mi_shortname, "_mini.tga");
143 if(precache_pic(minimapname) == "")
144 minimapname = ""; // FAIL
146 get_mi_min_max_texcoords(0); // load new texcoords
149 mi_center = (mi_min + mi_max) * 0.5;
150 mi_scale = mi_max - mi_min;
151 minimapname = strzone(minimapname);
154 // CSQC_Shutdown : Called every time the CSQC code is shutdown (changing maps, quitting, etc)
155 void CSQC_Shutdown(void)
169 cvar_clientsettemp_restore();
172 cvar_set("chase_active",ftos(chase_active_backup));
176 float SetTeam(entity o, float Team)
190 if(GetTeam(Team, false) == NULL)
192 print("trying to switch to unsupported team ", ftos(Team), "\n");
193 Team = COLOR_SPECTATOR;
206 if(GetTeam(Team, false) == NULL)
208 print("trying to switch to unsupported team ", ftos(Team), "\n");
209 Team = COLOR_SPECTATOR;
214 if(Team == -1) // leave
218 //print("(DISCONNECT) leave team ", ftos(o.team), "\n");
219 tm = GetTeam(o.team, false);
229 //print("(CONNECT) enter team ", ftos(o.team), "\n");
231 tm = GetTeam(Team, true);
236 else if(Team != o.team)
238 //print("(CHANGE) leave team ", ftos(o.team), "\n");
239 tm = GetTeam(o.team, false);
242 //print("(CHANGE) enter team ", ftos(o.team), "\n");
243 tm = GetTeam(Team, true);
251 void Playerchecker_Think()
255 for(i = 0; i < maxclients; ++i)
258 if(GetPlayerName(i) == "")
262 //print("playerchecker: KILL KILL KILL\n");
263 // player disconnected
274 //print("playerchecker: SPAWN SPAWN SPAWN\n");
277 playerslots[i] = e = spawn();
279 //e.gotscores = 0; // we might already have the scores...
280 SetTeam(e, GetPlayerColor(i)); // will not hurt; later updates come with Sbar_UpdatePlayerTeams
282 Sbar_UpdatePlayerPos(e);
286 self.nextthink = time + 0.2;
293 print(strcat("PostInit\n maxclients = ", ftos(maxclients), "\n"));
294 localcmd(strcat("\nsbar_columns_set ", cvar_string("sbar_columns"), ";\n"));
296 entity playerchecker;
297 playerchecker = spawn();
298 playerchecker.think = Playerchecker_Think;
299 playerchecker.nextthink = time + 0.2;
307 // CSQC_ConsoleCommand : Used to parse commands in the console that have been registered with the "registercmd" function
308 // Return value should be 1 if CSQC handled the command, otherwise return 0 to have the engine handle it.
310 void Cmd_Sbar_SetFields(float);
311 void Cmd_Sbar_Help(float);
312 float CSQC_ConsoleCommand(string strMessage)
316 //argc = tokenize(strMessage);
317 argc = tokenize_console(strMessage);
323 if(strCmd == "+button4") { // zoom
324 // return false, because the message shall be sent to the server anyway (for demos/speccing)
332 } else if(strCmd == "-button4") { // zoom
333 if(ignore_minus_zoom)
340 } else if(strCmd == "+button3") { // secondary
343 } else if(strCmd == "-button3") { // secondary
346 } else if(strCmd == "+showscores") {
347 sb_showscores = true;
349 } else if(strCmd == "-showscores") {
350 sb_showscores = false;
352 } else if(strCmd == "+showaccuracy") {
353 sb_showaccuracy = true;
355 } else if(strCmd == "-showaccuracy") {
356 sb_showaccuracy = false;
361 if(strCmd == "+forward" || strCmd == "-back") {
362 ++camera_direction_x;
364 } else if(strCmd == "-forward" || strCmd == "+back") {
365 --camera_direction_x;
367 } else if(strCmd == "+moveright" || strCmd == "-moveleft") {
368 --camera_direction_y;
370 } else if(strCmd == "-moveright" || strCmd == "+moveleft") {
371 ++camera_direction_y;
373 } else if(strCmd == "+moveup" || strCmd == "-movedown") {
374 ++camera_direction_z;
376 } else if(strCmd == "-moveup" || strCmd == "+movedown") {
377 --camera_direction_z;
379 } else if(strCmd == "+roll_right" || strCmd == "-roll_left") {
382 } else if(strCmd == "+roll_left" || strCmd == "-roll_right") {
391 entity debug_shotorg;
394 self.origin = view_origin + view_forward * self.view_ofs_x + view_right * self.view_ofs_y + view_up * self.view_ofs_z;
395 self.angles = view_angles;
396 self.angles_x = -self.angles_x;
400 void ShotOrg_Draw2D()
402 vector coord2d_topleft, coord2d_topright, coord2d;
406 s = vtos(self.view_ofs);
407 s = substring(s, 1, strlen(s) - 2);
408 if(tokenize_console(s) == 3)
409 s = strcat(argv(0), " ", argv(1), " ", argv(2));
411 coord2d_topleft = project_3d_to_2d(self.origin + view_up * 4 - view_right * 4);
412 coord2d_topright = project_3d_to_2d(self.origin + view_up * 4 + view_right * 4);
414 fs = '1 1 0' * ((coord2d_topright_x - coord2d_topleft_x) / stringwidth(s, FALSE));
416 coord2d = coord2d_topleft;
419 coord2d_x += (coord2d_topright_x - coord2d_topleft_x) * (1 - 8 / fs_x) * 0.5;
424 drawstring(coord2d, s, fs, '1 1 1', 1, 0);
429 debug_shotorg = spawn();
430 debug_shotorg.draw = ShotOrg_Draw;
431 debug_shotorg.draw2d = ShotOrg_Draw2D;
432 debug_shotorg.renderflags = RF_VIEWMODEL;
433 debug_shotorg.effects = EF_FULLBRIGHT;
434 precache_model("models/shotorg_adjuster.md3");
435 setmodel(debug_shotorg, "models/shotorg_adjuster.md3");
436 debug_shotorg.scale = 2;
437 debug_shotorg.view_ofs = '25 8 -8';
440 void GameCommand(string msg)
443 argc = tokenize_console(msg);
445 if(argv(0) == "help" || argc == 0)
447 print("Usage: cl_cmd COMMAND..., where possible commands are:\n");
448 print(" settemp cvar value\n");
450 print(" sbar_columns_set ...\n");
451 print(" sbar_columns_help\n");
452 GameCommand_Generic("help");
456 if(GameCommand_Generic(msg))
461 if(cmd == "mv_download") {
462 Cmd_MapVote_MapDownload(argc);
464 else if(cmd == "settemp") {
465 cvar_clientsettemp(argv(1), argv(2));
467 else if(cmd == "radar") {
468 ons_showmap = !ons_showmap;
470 else if(cmd == "sbar_columns_set") {
471 Cmd_Sbar_SetFields(argc);
473 else if(cmd == "sbar_columns_help") {
477 else if(cmd == "blurtest") {
478 blurtest_time0 = time;
479 blurtest_time1 = time + stof(argv(1));
480 blurtest_radius = stof(argv(2));
481 blurtest_power = stof(argv(3));
484 else if(cmd == "shotorg_move") {
488 debug_shotorg.view_ofs = debug_shotorg.view_ofs + stov(argv(1));
489 localcmd("sv_cmd debug_shotorg \"", vtos(debug_shotorg.view_ofs), "\"\n");
491 else if(cmd == "shotorg_movez") {
495 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
496 localcmd("sv_cmd debug_shotorg \"", vtos(debug_shotorg.view_ofs), "\"\n");
498 else if(cmd == "shotorg_set") {
502 debug_shotorg.view_ofs = stov(argv(1));
503 localcmd("sv_cmd debug_shotorg \"", vtos(debug_shotorg.view_ofs), "\"\n");
505 else if(cmd == "shotorg_setz") {
509 debug_shotorg.view_ofs = debug_shotorg.view_ofs * (stof(argv(1)) / debug_shotorg.view_ofs_x); // closer/farther, same xy pos
510 localcmd("sv_cmd debug_shotorg \"", vtos(debug_shotorg.view_ofs), "\"\n");
512 else if(cmd == "shotorg_toggle_hide") {
515 debug_shotorg.cnt = !debug_shotorg.cnt;
518 else if(cmd == "shotorg_end") {
521 print(vtos(debug_shotorg.view_ofs), "\n");
522 remove(debug_shotorg);
523 debug_shotorg = world;
525 localcmd("sv_cmd debug_shotorg\n");
529 print("Invalid command. For a list of supported commands, try cl_cmd help.\n");
535 // CSQC_InputEvent : Used to perform actions based on any key pressed, key released and mouse on the client.
536 // Return value should be 1 if CSQC handled the input, otherwise return 0 to have the input passed to the engine.
537 // All keys are in ascii.
538 // bInputType = 0 is key pressed, 1 is key released, 2 is mouse input.
539 // In the case of keyboard input, nPrimary is the ascii code, and nSecondary is 0.
540 // In the case of mouse input, nPrimary is xdelta, nSecondary is ydelta.
541 float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
543 local float bSkipKey;
547 if(menu_action(bInputType, nPrimary, nSecondary))
552 // END REQUIRED CSQC FUNCTIONS
553 // --------------------------------------------------------------------------
555 // --------------------------------------------------------------------------
556 // BEGIN OPTIONAL CSQC FUNCTIONS
559 InterpolateOrigin_Undo();
561 self.classname = "entcs_receiver";
562 self.sv_entnum = ReadByte() - 1;
563 self.origin_x = ReadShort();
564 self.origin_y = ReadShort();
565 self.origin_z = ReadShort();
566 self.angles_y = ReadByte() * 360.0 / 256;
567 self.origin_z = self.angles_x = self.angles_z = 0;
569 InterpolateOrigin_Note();
574 void Ent_RemovePlayerScore()
580 SetTeam(self.owner, -1);
581 self.owner.gotscores = 0;
582 for(i = 0; i < MAX_SCORE; ++i)
583 self.owner.(scores[i]) = 0; // clear all scores
587 void Ent_ReadPlayerScore()
593 // damnit -.- don't want to go change every single .sv_entnum in sbar.qc AGAIN
594 // (no I've never heard of M-x replace-string, sed, or anything like that)
595 isNew = !self.owner; // workaround for DP bug
598 #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED
599 if(!isNew && n != self.sv_entnum)
601 print("A CSQC entity changed its owner!\n");
604 self.enttype = ENT_CLIENT_SCORES;
610 if not(playerslots[self.sv_entnum])
611 playerslots[self.sv_entnum] = spawn();
612 o = self.owner = playerslots[self.sv_entnum];
613 o.sv_entnum = self.sv_entnum;
616 //if not(o.sort_prev)
617 // RegisterPlayer(o);
618 //playerchecker will do this for us later, if it has not already done so
629 for(i = 0, p = 1; i < MAX_SCORE; ++i, p *= 2)
633 o.(scores[i]) = ReadInt24_t();
635 o.(scores[i]) = ReadChar();
639 Sbar_UpdatePlayerPos(o); // if not registered, we cannot do this yet!
641 self.entremove = Ent_RemovePlayerScore;
644 void Ent_ReadTeamScore()
649 self.team = ReadByte();
650 o = self.owner = GetTeam(self.team, true); // these team numbers can always be trusted
653 #if MAX_TEAMSCORE <= 8
661 for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
665 o.(teamscores[i]) = ReadInt24_t();
667 o.(teamscores[i]) = ReadChar();
670 Sbar_UpdateTeamPos(o);
677 void Ent_ClientData()
680 float newspectatee_status;
684 sb_showscores_force = (f & 1);
688 newspectatee_status = ReadByte();
689 if(newspectatee_status == player_localentnum)
690 newspectatee_status = -1; // observing
693 newspectatee_status = 0;
695 spectatorbutton_zoom = (f & 4);
699 angles_held_status = 1;
700 angles_held_x = ReadAngle();
701 angles_held_y = ReadAngle();
705 angles_held_status = 0;
707 if(newspectatee_status != spectatee_status)
711 race_checkpointtime = 0;
713 spectatee_status = newspectatee_status;
718 float nags, i, j, b, f;
725 strunzone(vote_called_vote);
726 vote_called_vote = strzone(ColorTranslateRGB(ReadString()));
731 for(j = 0; j < maxclients; ++j)
733 playerslots[j].ready = 1;
734 for(i = 1; i <= maxclients; i += 8)
737 for(j = i-1, b = 1; b < 256; b *= 2, ++j)
740 playerslots[j].ready = 0;
744 ready_waiting = (nags & 1);
745 ready_waiting_for_me = (nags & 2);
746 vote_waiting = (nags & 4);
747 vote_waiting_for_me = (nags & 8);
748 warmup_stage = (nags & 16);
751 void Ent_RandomSeed()
759 // CSQC_Ent_Update : Called every frame that the server has indicated an update to the SSQC / CSQC entity has occured.
760 // The only parameter reflects if the entity is "new" to the client, meaning it just came into the client's PVS.
761 void Ent_RadarLink();
763 void Ent_ScoresInfo();
764 void(float bIsNewEntity) CSQC_Ent_Update =
770 // set up the "time" global for received entities to be correct for interpolation purposes
778 serverprevtime = time;
779 serverdeltatime = getstatf(STAT_MOVEVARS_TICRATE) * getstatf(STAT_MOVEVARS_TIMESCALE);
780 time = serverprevtime + serverdeltatime;
783 #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED
785 if(t != self.enttype)
787 print("A CSQC entity changed its type!\n");
794 case ENT_CLIENT_ENTCS: Ent_ReadEntCS(); break;
795 case ENT_CLIENT_SCORES: Ent_ReadPlayerScore(); break;
796 case ENT_CLIENT_TEAMSCORES: Ent_ReadTeamScore(); break;
797 case ENT_CLIENT_POINTPARTICLES: Ent_PointParticles(); break;
798 case ENT_CLIENT_RAINSNOW: Ent_RainOrSnow(); break;
799 case ENT_CLIENT_LASER: Ent_Laser(); break;
800 case ENT_CLIENT_NAGGER: Ent_Nagger(); break;
801 case ENT_CLIENT_WAYPOINT: Ent_WaypointSprite(); break;
802 case ENT_CLIENT_RADARLINK: Ent_RadarLink(); break;
803 case ENT_CLIENT_PROJECTILE: Ent_Projectile(); break;
804 case ENT_CLIENT_GIBSPLASH: Ent_GibSplash(); break;
805 case ENT_CLIENT_DAMAGEINFO: Ent_DamageInfo(); break;
806 case ENT_CLIENT_CASING: Ent_Casing(); break;
807 case ENT_CLIENT_INIT: Ent_Init(); break;
808 case ENT_CLIENT_SCORES_INFO: Ent_ScoresInfo(); break;
809 case ENT_CLIENT_MAPVOTE: Ent_MapVote(); break;
810 case ENT_CLIENT_CLIENTDATA: Ent_ClientData(); break;
811 case ENT_CLIENT_RANDOMSEED: Ent_RandomSeed(); break;
812 case ENT_CLIENT_WALL: Ent_Wall(); break;
813 case ENT_CLIENT_MODELEFFECT: Ent_ModelEffect(); break;
815 error(strcat("unknown entity type in CSQC_Ent_Update: ", ftos(self.enttype), "\n"));
821 // Destructor, but does NOT deallocate the entity by calling remove(). Also
822 // used when an entity changes its type. For an entity that someone interacts
823 // with others, make sure it can no longer do so.
831 self.draw = menu_sub_null;
832 self.entremove = menu_sub_null;
833 // TODO possibly set more stuff to defaults
835 // CSQC_Ent_Remove : Called when the server requests a SSQC / CSQC entity to be removed. Essentially call remove(self) as well.
836 void CSQC_Ent_Remove()
845 if(gametype == GAME_ONSLAUGHT) {
846 print(strcat("Using ", minimapname, " as minimap.\n"));
847 precache_pic("gfx/ons-cp-neutral.tga");
848 precache_pic("gfx/ons-cp-red.tga");
849 precache_pic("gfx/ons-cp-blue.tga");
850 precache_pic("gfx/ons-frame.tga");
851 precache_pic("gfx/ons-frame-team.tga");
852 } else if(gametype == GAME_KEYHUNT) {
853 precache_pic("gfx/sb_key_carrying");
854 precache_pic("gfx/sb_key_carrying_outline");
857 // 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.
858 void CSQC_Parse_StuffCmd(string strMessage)
860 localcmd(strMessage);
862 // 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.
863 void CSQC_Parse_Print(string strMessage)
865 print(ColorTranslateRGB(strMessage));
868 // CSQC_Parse_CenterPrint : Provides the centerprint string in the first parameter that the server provided.
869 void CSQC_Parse_CenterPrint(string strMessage)
871 centerprint(strMessage);
876 // TODO somehow thwart prvm_globalset client ...
879 localcmd(strcat("\nfog ", forcefog, "\nr_fog_exp2 0\nr_drawfog 1\n"));
882 void Gamemode_Init();
883 void Ent_ScoresInfo()
886 self.classname = "ent_client_scores_info";
887 gametype = ReadByte();
888 for(i = 0; i < MAX_SCORE; ++i)
890 scores_label[i] = strzone(ReadString());
891 scores_flags[i] = ReadByte();
893 for(i = 0; i < MAX_TEAMSCORE; ++i)
895 teamscores_label[i] = strzone(ReadString());
896 teamscores_flags[i] = ReadByte();
905 self.classname = "ent_client_init";
907 nb_pb_period = ReadByte() / 32; //Accuracy of 1/32th
909 for(i = 0; i < 24; ++i)
910 weaponimpulse[i] = ReadByte() - 1;
911 hook_shotorigin_x = ReadCoord();
912 hook_shotorigin_y = ReadCoord();
913 hook_shotorigin_z = ReadCoord();
917 forcefog = strzone(ReadString());
919 armorblockpercent = ReadByte() / 255.0;
933 case RACE_NET_CHECKPOINT_HIT_QUALIFYING:
934 race_checkpoint = ReadByte();
935 race_time = ReadInt24_t();
936 race_previousbesttime = ReadInt24_t();
937 if(race_previousbestname)
938 strunzone(race_previousbestname);
939 race_previousbestname = strzone(ColorTranslateRGB(ReadString()));
941 race_checkpointtime = time;
943 if(race_checkpoint == 0 || race_checkpoint == 254)
945 race_penaltyaccumulator = 0;
946 race_laptime = time; // valid
951 case RACE_NET_CHECKPOINT_CLEAR:
953 race_checkpointtime = 0;
956 case RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING:
957 race_laptime = ReadCoord();
958 race_checkpointtime = -99999;
960 case RACE_NET_CHECKPOINT_NEXT_QUALIFYING:
961 race_nextcheckpoint = ReadByte();
963 race_nextbesttime = ReadInt24_t();
964 if(race_nextbestname)
965 strunzone(race_nextbestname);
966 race_nextbestname = strzone(ColorTranslateRGB(ReadString()));
969 case RACE_NET_CHECKPOINT_HIT_RACE:
970 race_mycheckpoint = ReadByte();
971 race_mycheckpointtime = time;
972 race_mycheckpointdelta = ReadInt24_t();
973 race_mycheckpointlapsdelta = ReadByte();
974 if(race_mycheckpointlapsdelta >= 128)
975 race_mycheckpointlapsdelta -= 256;
976 if(race_mycheckpointenemy)
977 strunzone(race_mycheckpointenemy);
978 race_mycheckpointenemy = strzone(ColorTranslateRGB(ReadString()));
981 case RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT:
982 race_othercheckpoint = ReadByte();
983 race_othercheckpointtime = time;
984 race_othercheckpointdelta = ReadInt24_t();
985 race_othercheckpointlapsdelta = ReadByte();
986 if(race_othercheckpointlapsdelta >= 128)
987 race_othercheckpointlapsdelta -= 256;
988 if(race_othercheckpointenemy)
989 strunzone(race_othercheckpointenemy);
990 race_othercheckpointenemy = strzone(ColorTranslateRGB(ReadString()));
993 case RACE_NET_PENALTY_RACE:
994 race_penaltyeventtime = time;
995 race_penaltytime = ReadShort();
996 //race_penaltyaccumulator += race_penaltytime;
997 if(race_penaltyreason)
998 strunzone(race_penaltyreason);
999 race_penaltyreason = strzone(ReadString());
1002 case RACE_NET_PENALTY_QUALIFYING:
1003 race_penaltyeventtime = time;
1004 race_penaltytime = ReadShort();
1005 race_penaltyaccumulator += race_penaltytime;
1006 if(race_penaltyreason)
1007 strunzone(race_penaltyreason);
1008 race_penaltyreason = strzone(ReadString());
1013 void Net_ReadSpawn()
1016 current_viewzoom = 0.6;
1019 // CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer.
1020 // You must ALWAYS first acquire the temporary ID, which is sent as a byte.
1021 // Return value should be 1 if CSQC handled the temporary entity, otherwise return 0 to have the engine process the event.
1022 float CSQC_Parse_TempEntity()
1024 local float bHandled;
1030 // NOTE: Could just do return instead of break...
1033 case TE_CSQC_PICTURE:
1034 Net_MapVote_Picture();
1042 Net_GrapplingHook();
1049 case TE_CSQC_ZCURVEPARTICLES:
1050 Net_ReadZCurveParticles();
1053 case TE_CSQC_NEXGUNBEAMPARTICLE:
1054 Net_ReadNexgunBeamParticle();
1057 case TE_CSQC_LIGHTNINGARC:
1058 Net_ReadLightningarc();
1062 // No special logic for this temporary entity; return 0 so the engine can handle it
1070 string getcommandkey(string text, string command)
1075 if (!sbar_showbinds)
1078 keys = db_get(binddb, command);
1081 n = tokenize(findkeysforcommand(command)); // uses '...' strings
1082 for(j = 0; j < n; ++j)
1088 keys = keynumtostring(k);
1090 keys = strcat(keys, ", ", keynumtostring(k));
1093 if (sbar_showbinds_limit > 0 && sbar_showbinds_limit >= l) break;
1097 db_put(binddb, command, keys);
1101 if (sbar_showbinds > 1)
1102 return strcat(text, " (not bound)");
1106 else if (sbar_showbinds > 1)
1107 return strcat(text, " (", keys, ")");