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)
188 if(GetTeam(Team, false) == NULL)
190 print("trying to switch to unsupported team ", ftos(Team), "\n");
191 Team = COLOR_SPECTATOR;
195 if(Team == -1) // leave
199 //print("(DISCONNECT) leave team ", ftos(o.team), "\n");
200 tm = GetTeam(o.team, false);
210 //print("(CONNECT) enter team ", ftos(o.team), "\n");
212 tm = GetTeam(Team, true);
217 else if(Team != o.team)
219 //print("(CHANGE) leave team ", ftos(o.team), "\n");
220 tm = GetTeam(o.team, false);
223 //print("(CHANGE) enter team ", ftos(o.team), "\n");
224 tm = GetTeam(Team, true);
232 void Playerchecker_Think()
236 for(i = 0; i < maxclients; ++i)
239 if(GetPlayerName(i) == "")
243 //print("playerchecker: KILL KILL KILL\n");
244 // player disconnected
255 //print("playerchecker: SPAWN SPAWN SPAWN\n");
258 playerslots[i] = e = spawn();
260 //e.gotscores = 0; // we might already have the scores...
261 SetTeam(e, GetPlayerColor(i)); // will not hurt; later updates come with Sbar_UpdatePlayerTeams
263 Sbar_UpdatePlayerPos(e);
267 self.nextthink = time + 0.2;
274 print(strcat("PostInit\n maxclients = ", ftos(maxclients), "\n"));
275 localcmd(strcat("\nsbar_columns_set ", cvar_string("sbar_columns"), ";\n"));
277 entity playerchecker;
278 playerchecker = spawn();
279 playerchecker.think = Playerchecker_Think;
280 playerchecker.nextthink = time + 0.2;
288 // CSQC_ConsoleCommand : Used to parse commands in the console that have been registered with the "registercmd" function
289 // Return value should be 1 if CSQC handled the command, otherwise return 0 to have the engine handle it.
291 void Cmd_Sbar_SetFields(float);
292 void Cmd_Sbar_Help(float);
293 float CSQC_ConsoleCommand(string strMessage)
297 //argc = tokenize(strMessage);
298 argc = tokenize_console(strMessage);
304 if(strCmd == "+button4") { // zoom
305 // return false, because the message shall be sent to the server anyway (for demos/speccing)
313 } else if(strCmd == "-button4") { // zoom
314 if(ignore_minus_zoom)
321 } else if(strCmd == "+button3") { // secondary
324 } else if(strCmd == "-button3") { // secondary
327 } else if(strCmd == "+showscores") {
328 sb_showscores = true;
330 } else if(strCmd == "-showscores") {
331 sb_showscores = false;
333 } else if(strCmd == "+showaccuracy") {
334 sb_showaccuracy = true;
336 } else if(strCmd == "-showaccuracy") {
337 sb_showaccuracy = false;
342 if(strCmd == "+forward" || strCmd == "-back") {
343 ++camera_direction_x;
345 } else if(strCmd == "-forward" || strCmd == "+back") {
346 --camera_direction_x;
348 } else if(strCmd == "+moveright" || strCmd == "-moveleft") {
349 --camera_direction_y;
351 } else if(strCmd == "-moveright" || strCmd == "+moveleft") {
352 ++camera_direction_y;
354 } else if(strCmd == "+moveup" || strCmd == "-movedown") {
355 ++camera_direction_z;
357 } else if(strCmd == "-moveup" || strCmd == "+movedown") {
358 --camera_direction_z;
360 } else if(strCmd == "+roll_right" || strCmd == "-roll_left") {
363 } else if(strCmd == "+roll_left" || strCmd == "-roll_right") {
372 entity debug_shotorg;
375 self.origin = view_origin + view_forward * self.view_ofs_x + view_right * self.view_ofs_y + view_up * self.view_ofs_z;
376 self.angles = view_angles;
377 self.angles_x = -self.angles_x;
381 void ShotOrg_Draw2D()
383 vector coord2d_topleft, coord2d_topright, coord2d;
387 s = vtos(self.view_ofs);
388 s = substring(s, 1, strlen(s) - 2);
389 if(tokenize_console(s) == 3)
390 s = strcat(argv(0), " ", argv(1), " ", argv(2));
392 coord2d_topleft = project_3d_to_2d(self.origin + view_up * 4 - view_right * 4);
393 coord2d_topright = project_3d_to_2d(self.origin + view_up * 4 + view_right * 4);
395 fs = '1 1 0' * ((coord2d_topright_x - coord2d_topleft_x) / stringwidth(s, FALSE));
397 coord2d = coord2d_topleft;
400 coord2d_x += (coord2d_topright_x - coord2d_topleft_x) * (1 - 8 / fs_x) * 0.5;
405 drawstring(coord2d, s, fs, '1 1 1', 1, 0);
410 debug_shotorg = spawn();
411 debug_shotorg.draw = ShotOrg_Draw;
412 debug_shotorg.draw2d = ShotOrg_Draw2D;
413 debug_shotorg.renderflags = RF_VIEWMODEL;
414 debug_shotorg.effects = EF_FULLBRIGHT;
415 precache_model("models/shotorg_adjuster.md3");
416 setmodel(debug_shotorg, "models/shotorg_adjuster.md3");
417 debug_shotorg.scale = 2;
418 debug_shotorg.view_ofs = '25 8 -8';
421 void GameCommand(string msg)
424 argc = tokenize_console(msg);
426 if(argv(0) == "help" || argc == 0)
428 print("Usage: cl_cmd COMMAND..., where possible commands are:\n");
429 print(" settemp cvar value\n");
431 print(" sbar_columns_set ...\n");
432 print(" sbar_columns_help\n");
433 GameCommand_Generic("help");
437 if(GameCommand_Generic(msg))
442 if(cmd == "mv_download") {
443 Cmd_MapVote_MapDownload(argc);
445 else if(cmd == "settemp") {
446 cvar_clientsettemp(argv(1), argv(2));
448 else if(cmd == "radar") {
449 ons_showmap = !ons_showmap;
451 else if(cmd == "sbar_columns_set") {
452 Cmd_Sbar_SetFields(argc);
454 else if(cmd == "sbar_columns_help") {
458 else if(cmd == "blurtest") {
459 blurtest_time0 = time;
460 blurtest_time1 = time + stof(argv(1));
461 blurtest_radius = stof(argv(2));
462 blurtest_power = stof(argv(3));
465 else if(cmd == "shotorg_move") {
469 debug_shotorg.view_ofs = debug_shotorg.view_ofs + stov(argv(1));
470 localcmd("sv_cmd debug_shotorg \"", vtos(debug_shotorg.view_ofs), "\"\n");
472 else if(cmd == "shotorg_movez") {
476 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
477 localcmd("sv_cmd debug_shotorg \"", vtos(debug_shotorg.view_ofs), "\"\n");
479 else if(cmd == "shotorg_set") {
483 debug_shotorg.view_ofs = stov(argv(1));
484 localcmd("sv_cmd debug_shotorg \"", vtos(debug_shotorg.view_ofs), "\"\n");
486 else if(cmd == "shotorg_setz") {
490 debug_shotorg.view_ofs = debug_shotorg.view_ofs * (stof(argv(1)) / debug_shotorg.view_ofs_x); // closer/farther, same xy pos
491 localcmd("sv_cmd debug_shotorg \"", vtos(debug_shotorg.view_ofs), "\"\n");
493 else if(cmd == "shotorg_toggle_hide") {
496 debug_shotorg.cnt = !debug_shotorg.cnt;
499 else if(cmd == "shotorg_end") {
502 print(vtos(debug_shotorg.view_ofs), "\n");
503 remove(debug_shotorg);
504 debug_shotorg = world;
506 localcmd("sv_cmd debug_shotorg\n");
510 print("Invalid command. For a list of supported commands, try cl_cmd help.\n");
516 // CSQC_InputEvent : Used to perform actions based on any key pressed, key released and mouse on the client.
517 // Return value should be 1 if CSQC handled the input, otherwise return 0 to have the input passed to the engine.
518 // All keys are in ascii.
519 // bInputType = 0 is key pressed, 1 is key released, 2 is mouse input.
520 // In the case of keyboard input, nPrimary is the ascii code, and nSecondary is 0.
521 // In the case of mouse input, nPrimary is xdelta, nSecondary is ydelta.
522 float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
524 local float bSkipKey;
528 if(menu_action(bInputType, nPrimary, nSecondary))
533 // END REQUIRED CSQC FUNCTIONS
534 // --------------------------------------------------------------------------
536 // --------------------------------------------------------------------------
537 // BEGIN OPTIONAL CSQC FUNCTIONS
540 InterpolateOrigin_Undo();
542 self.classname = "entcs_receiver";
543 self.sv_entnum = ReadByte() - 1;
544 self.origin_x = ReadShort();
545 self.origin_y = ReadShort();
546 self.origin_z = ReadShort();
547 self.angles_y = ReadByte() * 360.0 / 256;
548 self.origin_z = self.angles_x = self.angles_z = 0;
550 InterpolateOrigin_Note();
555 void Ent_RemovePlayerScore()
561 SetTeam(self.owner, -1);
562 self.owner.gotscores = 0;
563 for(i = 0; i < MAX_SCORE; ++i)
564 self.owner.(scores[i]) = 0; // clear all scores
568 void Ent_ReadPlayerScore()
574 // damnit -.- don't want to go change every single .sv_entnum in sbar.qc AGAIN
575 // (no I've never heard of M-x replace-string, sed, or anything like that)
576 isNew = !self.owner; // workaround for DP bug
579 #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED
580 if(!isNew && n != self.sv_entnum)
582 print("A CSQC entity changed its owner!\n");
585 self.enttype = ENT_CLIENT_SCORES;
591 if not(playerslots[self.sv_entnum])
592 playerslots[self.sv_entnum] = spawn();
593 o = self.owner = playerslots[self.sv_entnum];
594 o.sv_entnum = self.sv_entnum;
597 //if not(o.sort_prev)
598 // RegisterPlayer(o);
599 //playerchecker will do this for us later, if it has not already done so
602 for(i = 0; i < MAX_SCORE; ++i)
603 o.(scores[i]) = ReadShort();
612 for(i = 0, p = 1; i < MAX_SCORE; ++i, p *= 2)
614 o.(scores[i]) = ReadShort();
618 Sbar_UpdatePlayerPos(o); // if not registered, we cannot do this yet!
620 self.entremove = Ent_RemovePlayerScore;
623 void Ent_ReadTeamScore()
628 self.team = ReadByte();
629 o = self.owner = GetTeam(self.team, true); // these team numbers can always be trusted
631 #if MAX_TEAMSCORE <= 3
632 for(i = 0; i < MAX_TEAMSCORE; ++i)
633 o.(teamscores[i]) = ReadShort();
636 #if MAX_TEAMSCORE <= 8
642 for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
644 o.(teamscores[i]) = ReadShort();
647 Sbar_UpdateTeamPos(o);
654 void Ent_ClientData()
657 float newspectatee_status;
661 sb_showscores_force = (f & 1);
665 newspectatee_status = ReadByte();
666 if(newspectatee_status == player_localentnum)
667 newspectatee_status = -1; // observing
670 newspectatee_status = 0;
672 spectatorbutton_zoom = (f & 4);
676 angles_held_status = 1;
677 angles_held_x = ReadAngle();
678 angles_held_y = ReadAngle();
682 angles_held_status = 0;
684 if(newspectatee_status != spectatee_status)
688 race_checkpointtime = 0;
690 spectatee_status = newspectatee_status;
695 float nags, i, j, b, f;
702 strunzone(vote_called_vote);
703 vote_called_vote = strzone(ColorTranslateRGB(ReadString()));
708 for(j = 0; j < maxclients; ++j)
710 playerslots[j].ready = 1;
711 for(i = 1; i <= maxclients; i += 8)
714 for(j = i-1, b = 1; b < 256; b *= 2, ++j)
717 playerslots[j].ready = 0;
721 ready_waiting = (nags & 1);
722 ready_waiting_for_me = (nags & 2);
723 vote_waiting = (nags & 4);
724 vote_waiting_for_me = (nags & 8);
725 warmup_stage = (nags & 16);
728 void Ent_RandomSeed()
736 // CSQC_Ent_Update : Called every frame that the server has indicated an update to the SSQC / CSQC entity has occured.
737 // The only parameter reflects if the entity is "new" to the client, meaning it just came into the client's PVS.
738 void Ent_RadarLink();
740 void Ent_ScoresInfo();
741 void(float bIsNewEntity) CSQC_Ent_Update =
747 // set up the "time" global for received entities to be correct for interpolation purposes
755 serverprevtime = time;
756 serverdeltatime = getstatf(STAT_MOVEVARS_TICRATE) * getstatf(STAT_MOVEVARS_TIMESCALE);
757 time = serverprevtime + serverdeltatime;
760 #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED
762 if(t != self.enttype)
764 print("A CSQC entity changed its type!\n");
771 case ENT_CLIENT_ENTCS: Ent_ReadEntCS(); break;
772 case ENT_CLIENT_SCORES: Ent_ReadPlayerScore(); break;
773 case ENT_CLIENT_TEAMSCORES: Ent_ReadTeamScore(); break;
774 case ENT_CLIENT_POINTPARTICLES: Ent_PointParticles(); break;
775 case ENT_CLIENT_RAINSNOW: Ent_RainOrSnow(); break;
776 case ENT_CLIENT_LASER: Ent_Laser(); break;
777 case ENT_CLIENT_NAGGER: Ent_Nagger(); break;
778 case ENT_CLIENT_WAYPOINT: Ent_WaypointSprite(); break;
779 case ENT_CLIENT_RADARLINK: Ent_RadarLink(); break;
780 case ENT_CLIENT_PROJECTILE: Ent_Projectile(); break;
781 case ENT_CLIENT_GIBSPLASH: Ent_GibSplash(); break;
782 case ENT_CLIENT_DAMAGEINFO: Ent_DamageInfo(); break;
783 case ENT_CLIENT_CASING: Ent_Casing(); break;
784 case ENT_CLIENT_INIT: Ent_Init(); break;
785 case ENT_CLIENT_SCORES_INFO: Ent_ScoresInfo(); break;
786 case ENT_CLIENT_MAPVOTE: Ent_MapVote(); break;
787 case ENT_CLIENT_CLIENTDATA: Ent_ClientData(); break;
788 case ENT_CLIENT_RANDOMSEED: Ent_RandomSeed(); break;
789 case ENT_CLIENT_WALL: Ent_Wall(); break;
791 error(strcat("unknown entity type in CSQC_Ent_Update: ", ftos(self.enttype), "\n"));
797 // Destructor, but does NOT deallocate the entity by calling remove(). Also
798 // used when an entity changes its type. For an entity that someone interacts
799 // with others, make sure it can no longer do so.
807 self.draw = menu_sub_null;
808 self.entremove = menu_sub_null;
809 // TODO possibly set more stuff to defaults
811 // CSQC_Ent_Remove : Called when the server requests a SSQC / CSQC entity to be removed. Essentially call remove(self) as well.
812 void CSQC_Ent_Remove()
821 if(gametype == GAME_ONSLAUGHT) {
822 print(strcat("Using ", minimapname, " as minimap.\n"));
823 precache_pic("gfx/ons-cp-neutral.tga");
824 precache_pic("gfx/ons-cp-red.tga");
825 precache_pic("gfx/ons-cp-blue.tga");
826 precache_pic("gfx/ons-frame.tga");
827 precache_pic("gfx/ons-frame-team.tga");
828 } else if(gametype == GAME_KEYHUNT) {
829 precache_pic("gfx/sb_key_carrying");
830 precache_pic("gfx/sb_key_carrying_outline");
833 // 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.
834 void CSQC_Parse_StuffCmd(string strMessage)
836 localcmd(strMessage);
838 // 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.
839 void CSQC_Parse_Print(string strMessage)
841 print(ColorTranslateRGB(strMessage));
844 // CSQC_Parse_CenterPrint : Provides the centerprint string in the first parameter that the server provided.
845 void CSQC_Parse_CenterPrint(string strMessage)
847 centerprint(strMessage);
852 // TODO somehow thwart prvm_globalset client ...
855 localcmd(strcat("\nfog ", forcefog, "\nr_fog_exp2 0\nr_drawfog 1\n"));
858 void Gamemode_Init();
859 void Ent_ScoresInfo()
862 self.classname = "ent_client_scores_info";
863 gametype = ReadByte();
864 for(i = 0; i < MAX_SCORE; ++i)
866 scores_label[i] = strzone(ReadString());
867 scores_flags[i] = ReadByte();
869 for(i = 0; i < MAX_TEAMSCORE; ++i)
871 teamscores_label[i] = strzone(ReadString());
872 teamscores_flags[i] = ReadByte();
881 self.classname = "ent_client_init";
883 nb_pb_period = ReadByte() / 32; //Accuracy of 1/32th
885 for(i = 0; i < 24; ++i)
886 weaponimpulse[i] = ReadByte() - 1;
887 hook_shotorigin_x = ReadCoord();
888 hook_shotorigin_y = ReadCoord();
889 hook_shotorigin_z = ReadCoord();
893 forcefog = strzone(ReadString());
895 armorblockpercent = ReadByte() / 255.0;
909 case RACE_NET_CHECKPOINT_HIT_QUALIFYING:
910 race_checkpoint = ReadByte();
911 race_time = ReadShort();
912 race_previousbesttime = ReadShort();
913 if(race_previousbestname)
914 strunzone(race_previousbestname);
915 race_previousbestname = strzone(ColorTranslateRGB(ReadString()));
917 race_checkpointtime = time;
919 if(race_checkpoint == 0 || race_checkpoint == 254)
921 race_penaltyaccumulator = 0;
922 race_laptime = time; // valid
927 case RACE_NET_CHECKPOINT_CLEAR:
929 race_checkpointtime = 0;
932 case RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING:
933 race_laptime = ReadCoord();
934 race_checkpointtime = -99999;
936 case RACE_NET_CHECKPOINT_NEXT_QUALIFYING:
937 race_nextcheckpoint = ReadByte();
939 race_nextbesttime = ReadShort();
940 if(race_nextbestname)
941 strunzone(race_nextbestname);
942 race_nextbestname = strzone(ColorTranslateRGB(ReadString()));
945 case RACE_NET_CHECKPOINT_HIT_RACE:
946 race_mycheckpoint = ReadByte();
947 race_mycheckpointtime = time;
948 race_mycheckpointdelta = ReadShort();
949 race_mycheckpointlapsdelta = ReadByte();
950 if(race_mycheckpointlapsdelta >= 128)
951 race_mycheckpointlapsdelta -= 256;
952 if(race_mycheckpointenemy)
953 strunzone(race_mycheckpointenemy);
954 race_mycheckpointenemy = strzone(ColorTranslateRGB(ReadString()));
957 case RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT:
958 race_othercheckpoint = ReadByte();
959 race_othercheckpointtime = time;
960 race_othercheckpointdelta = ReadShort();
961 race_othercheckpointlapsdelta = ReadByte();
962 if(race_othercheckpointlapsdelta >= 128)
963 race_othercheckpointlapsdelta -= 256;
964 if(race_othercheckpointenemy)
965 strunzone(race_othercheckpointenemy);
966 race_othercheckpointenemy = strzone(ColorTranslateRGB(ReadString()));
969 case RACE_NET_PENALTY_RACE:
970 race_penaltyeventtime = time;
971 race_penaltytime = ReadByte();
972 //race_penaltyaccumulator += race_penaltytime;
973 if(race_penaltyreason)
974 strunzone(race_penaltyreason);
975 race_penaltyreason = strzone(ReadString());
978 case RACE_NET_PENALTY_QUALIFYING:
979 race_penaltyeventtime = time;
980 race_penaltytime = ReadByte();
981 race_penaltyaccumulator += race_penaltytime;
982 if(race_penaltyreason)
983 strunzone(race_penaltyreason);
984 race_penaltyreason = strzone(ReadString());
992 current_viewzoom = 0.6;
995 // CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer.
996 // You must ALWAYS first acquire the temporary ID, which is sent as a byte.
997 // Return value should be 1 if CSQC handled the temporary entity, otherwise return 0 to have the engine process the event.
998 float CSQC_Parse_TempEntity()
1000 local float bHandled;
1006 // NOTE: Could just do return instead of break...
1009 case TE_CSQC_PICTURE:
1010 Net_MapVote_Picture();
1018 Net_GrapplingHook();
1025 case TE_CSQC_ZCURVEPARTICLES:
1026 Net_ReadZCurveParticles();
1029 case TE_CSQC_NEXGUNBEAMPARTICLE:
1030 Net_ReadNexgunBeamParticle();
1033 case TE_CSQC_LIGHTNINGARC:
1034 Net_ReadLightningarc();
1038 // No special logic for this temporary entity; return 0 so the engine can handle it
1046 string getcommandkey(string text, string command)
1051 if (!sbar_showbinds)
1054 keys = db_get(binddb, command);
1057 n = tokenize(findkeysforcommand(command)); // uses '...' strings
1058 for(j = 0; j < n; ++j)
1064 keys = keynumtostring(k);
1066 keys = strcat(keys, ", ", keynumtostring(k));
1069 if (sbar_showbinds_limit > 0 && sbar_showbinds_limit >= l) break;
1073 db_put(binddb, command, keys);
1077 if (sbar_showbinds > 1)
1078 return strcat(text, " (not bound)");
1082 else if (sbar_showbinds > 1)
1083 return strcat(text, " (", keys, ")");