32#define CONSTNAMEINT_HASH_SIZE 32
34#define MAX_CONSTNAMEINT_NAME 32
39typedef struct com_constNameInt_s {
44 struct com_constNameInt_s*
next;
59 const char* space = strstr(
name,
"::");
81 if (
Q_streq(variable, a->name)) {
124 const size_t namespaceLength = strlen(space);
129 if (!strncmp(a->
fullname, space, namespaceLength))
209 }
else if (!strncmp(variable, a->
name,
sizeof(a->
name))) {
215 Com_Printf(
"Com_RegisterConstInt: Const string already defined. '%s = %d' is not set.\n",
name, value);
241 for (
int i = 0; constList[
i].
name !=
nullptr;
i++)
255 for (
int i = 0; constList[
i].
name !=
nullptr;
i++)
277const char*
Com_EParse (
const char** text,
const char* errhead,
const char* errinfo,
char* target,
size_t size)
298 Sys_Error(
"You are mixing versions of the binary (" UFO_VERSION ") and the script (%s) files.", version);
300 Sys_Error(
"More than one version string found in the script files.");
321 "translation_string",
341 "ul",
"uc",
"ur",
"cl",
"cc",
"cr",
"ll",
"lc",
"lr",
"ul_rsl",
"uc_rsl",
"ur_rsl",
"cl_rsl",
"cc_rsl",
"cr_rsl",
"ll_rsl",
"lc_rsl",
"lr_rsl"
346 "replace",
"one",
"blend",
"add",
"filter",
"invfilter"
351 "facing",
"rotated",
"beam",
"line",
"axis",
"circle"
356 "none",
"in",
"out",
"sin",
"saw"
440 assert(memory !=
nullptr);
442 Sys_Error(
"Com_AlignPtr: can't align V_NULL");
444 Sys_Error(
"Com_AlignPtr: type hit V_NUM_TYPES");
445 return ALIGN_PTR(memory, align);
599 Com_Printf(
"Com_ParseAircraftNames: Unknown aircraft name type '%s' ignored\n",
name);
604 if (!*text || *token !=
'{') {
605 Com_Printf(
"Com_ParseAircraftNames: names def \"%s\" without body ignored\n",
name);
621 Com_Printf(
"Com_ParseAircraftNames: Unknown aircraft type '%s' without max ids ignored\n",
name);
624 const char*
const errhead =
"Com_ParseAircraftNames: Unexpected end of file (name type ";
633 Com_Printf(
"Com_ParseAircraftNames: Too many aircraft ids for type '%s', '%s' ignored!\n",
name, token);
637 Com_Printf(
"Com_ParseAircraftNames: Aircraft with same name found '%s', second ignored\n", token);
661 byte* b = (
byte*) base + ofs;
694 if (
Q_streq(token,
"true") || *token ==
'1')
696 else if (
Q_streq(token,
"false") || *token ==
'0')
702 *writtenBytes =
sizeof(bool);
706 if (token[0] ==
'\0') {
710 if (token[1] !=
'\0') {
714 *(
char*) b = token[0];
715 *writtenBytes =
sizeof(char);
719 if (
Q_streq(token,
"civilian"))
721 else if (
Q_streq(token,
"phalanx"))
723 else if (
Q_streq(token,
"alien"))
726 Sys_Error(
"Unknown team string: '%s' found in script files", token);
727 *writtenBytes =
sizeof(
int);
735 Sys_Error(
"Unknown aircraft type: '%s'", token);
744 Sys_Error(
"Unknown ufo type: '%s'", token);
753 Sys_Error(
"Unknown ufo type: '%s'", token);
758 if (sscanf(token,
"%i", &((
int*) b)[0]) != 1) {
764 *writtenBytes =
sizeof(
int);
768 if (sscanf(token,
"%i %i", &((
int*) b)[0], &((
int*) b)[1]) != 2) {
772 *writtenBytes = 2 *
sizeof(
int);
776 if (sscanf(token,
"%f", &((
float*) b)[0]) != 1) {
780 *writtenBytes =
sizeof(float);
784 if (sscanf(token,
"%f %f", &((
float*) b)[0], &((
float*) b)[1]) != 2) {
788 *writtenBytes = 2 *
sizeof(float);
792 if (sscanf(token,
"%f %f %f", &((
float*) b)[0], &((
float*) b)[1], &((
float*) b)[2]) != 3) {
796 *writtenBytes = 3 *
sizeof(float);
801 float*
f = (
float*) b;
802 if (sscanf(token,
"%f %f %f %f", &
f[0], &
f[1], &
f[2], &
f[3]) != 4) {
806 *writtenBytes = 4 *
sizeof(float);
812 w = (
int)strlen(token) + 1;
822 w = (
int)strlen((
char*) b) + 1;
827 strcpy((
char*) b, token);
828 w = (
int)strlen(token) + 1;
841 *writtenBytes =
sizeof(
align_t);
853 *writtenBytes =
sizeof(
blend_t);
865 *writtenBytes =
sizeof(
style_t);
877 *writtenBytes =
sizeof(
fade_t);
881 if (sscanf(token,
"%i %i %i %i", &x, &y, &w, &h) != 4) {
894 for (h += y; y < h; y++)
900 if (sscanf(token,
"%i %i %i %i", &x, &y, &w, &h) != 4) {
912 w = ((1 << w) - 1) << x;
913 for (h += y; y < h; y++)
914 ((uint32_t*) b)[y] |= w;
919 for (num = 0; num <
csi.numDTs; num++)
922 if (num ==
csi.numDTs)
926 *writtenBytes =
sizeof(
byte);
930 if (token[0] ==
'-' || token[0] ==
'+') {
931 if (fabs(atof(token + 1)) <= 2.0f) {
936 *(
float*) b = atof(token + 1) * (-1);
938 *(
float*) b = atof(token + 1);
940 if (fabs(atof(token)) > 2.0f) {
944 *(
float*) b = atof(token);
946 *writtenBytes =
sizeof(float);
991 assert(writtenBytes ==
sizeof(b));
1007int Com_SetValueDebug (
void* base,
const void* set,
valueTypes_t type,
int ofs,
size_t size,
const char* file,
int line)
1016 byte* b = (
byte*) base + ofs;
1043 if (*(
const bool*) set)
1047 return sizeof(bool);
1050 *(
char*) b = *(
const char*) set;
1051 return sizeof(char);
1054 if (
Q_streq((
const char*)set,
"civilian"))
1056 else if (
Q_streq((
const char*)set,
"phalanx"))
1058 else if (
Q_streq((
const char*)set,
"alien"))
1061 Sys_Error(
"Unknown team given: '%s'", (
const char*)set);
1069 Sys_Error(
"Unknown aircraft type: '%s'", (
const char*)set);
1077 Sys_Error(
"Unknown ufo type: '%s'", (
const char*)set);
1085 Sys_Error(
"Unknown ufo type: '%s'", (
const char*)set);
1089 *(
int*) b = *(
const int*) set;
1093 ((
int*) b)[0] = ((
const int*) set)[0];
1094 ((
int*) b)[1] = ((
const int*) set)[1];
1095 return 2 *
sizeof(
int);
1098 *(
float*) b = *(
const float*) set;
1099 return sizeof(float);
1102 ((
float*) b)[0] = ((
const float*) set)[0];
1103 ((
float*) b)[1] = ((
const float*) set)[1];
1104 return 2 *
sizeof(float);
1107 ((
float*) b)[0] = ((
const float*) set)[0];
1108 ((
float*) b)[1] = ((
const float*) set)[1];
1109 ((
float*) b)[2] = ((
const float*) set)[2];
1110 return 3 *
sizeof(float);
1113 ((
float*) b)[0] = ((
const float*) set)[0];
1114 ((
float*) b)[1] = ((
const float*) set)[1];
1115 ((
float*) b)[2] = ((
const float*) set)[2];
1116 ((
float*) b)[3] = ((
const float*) set)[3];
1117 return 4 *
sizeof(float);
1121 len = (
int)strlen((
const char*) set) + 1;
1127 strcpy((
char*) b, (
const char*) set);
1128 len = (
int)strlen((
const char*) set) + 1;
1148 *(
int*) b = *(
const int*) set;
1156 *b = *(
const byte*) set;
1160 Sys_Error(
"Com_SetValue: unknown value type\n");
1173 static char valuestr[
MAX_VAR];
1174 const byte* b = (
const byte*) base + ofs;
1191 return (
const char*)b;
1194 if (*(
const bool*)b)
1200 return (
const char*) b;
1204 switch (*(
const int*) b) {
1212 Sys_Error(
"Unknown team id '%i'", *(
const int*) b);
1237 Com_sprintf(valuestr,
sizeof(valuestr),
"%i", *(
const int*) b);
1241 Com_sprintf(valuestr,
sizeof(valuestr),
"%i %i", ((
const int*) b)[0], ((
const int*) b)[1]);
1245 Com_sprintf(valuestr,
sizeof(valuestr),
"%.2f", *(
const float*) b);
1249 Com_sprintf(valuestr,
sizeof(valuestr),
"%.2f %.2f", ((
const float*) b)[0], ((
const float*) b)[1]);
1253 Com_sprintf(valuestr,
sizeof(valuestr),
"%.2f %.2f %.2f", ((
const float*) b)[0], ((
const float*) b)[1], ((
const float*) b)[2]);
1257 Com_sprintf(valuestr,
sizeof(valuestr),
"%.2f %.2f %.2f %.2f", ((
const float*) b)[0], ((
const float*) b)[1], ((
const float*) b)[2], ((
const float*) b)[3]);
1264 return (
const char*) b;
1292 return csi.dts[*(
const byte*)b].
id;
1296 if (*(
const float*) b > 2.0)
1297 Com_sprintf(valuestr,
sizeof(valuestr),
"+%.2f", *(
const float*) b);
1299 else if (*(
const float*) b < 2.0)
1300 Com_sprintf(valuestr,
sizeof(valuestr),
"-%.2f", *(
const float*) b);
1303 Com_sprintf(valuestr,
sizeof(valuestr),
"%.2f", *(
const float*) b);
1314 const char* errhead =
"Com_ParseBlockToken: unexpected end of file (";
1316 for (
v = values;
v->string;
v++)
1325 if (mempool ==
nullptr) {
1327 Com_Printf(
"Com_ParseBlockToken: Wrong size for value %s\n",
v->string);
1347 Com_Printf(
"Com_ParseBlockToken: Wrong size for value %s\n",
v->string);
1353 return v->string !=
nullptr;
1377 Com_Printf(
"Com_ParseList: expected list content but end of file found\n");
1395 const char* errhead =
"Com_ParseBlock: unexpected end of file (";
1400 if (!*text || *token !=
'{') {
1401 Com_Printf(
"Com_ParseBlock: block \"%s\" without body ignored\n",
name);
1413 Com_Printf(
"Com_ParseBlock: unknown token '%s' ignored (%s)\n", token,
name);
1569 Com_Printf(
"Com_ParseItemEffect: syntax error for item '%s'\n",
name);
1573 if (
Q_streq(token,
"active")) {
1575 }
else if (
Q_streq(token,
"inactive")) {
1577 }
else if (
Q_streq(token,
"overdose")) {
1579 }
else if (
Q_streq(token,
"strengthen")) {
1583 if (!*text || *token !=
'{') {
1584 Com_Printf(
"Com_ParseItemEffect: syntax error for item '%s'\n",
name);
1588 Com_Printf(
"Com_ParseItemEffect: item effect of \"%s\" has invalid effect stage: '%s'\n",
name, token);
1593 if (token[0] !=
'{') {
1594 Com_Printf(
"Com_ParseItemEffect: syntax error for item '%s'\n",
name);
1606 Com_Printf(
"Com_ParseItemEffect: item effect of \"%s\" contains invalid values\n",
name);
1647 if (stagePtr ==
nullptr) {
1649 Com_Printf(
"Com_ParseFireEffect: invalid effect stage for '%s'\n",
name);
1653 if (*stagePtr !=
nullptr) {
1655 Com_Printf(
"Com_ParseFireEffect: item effect of \"%s\" already has an effect assigned\n",
name);
1670 const char* errhead =
"Com_ParseFire: unexpected end of file";
1675 if (!*text || *token !=
'{') {
1676 Com_Printf(
"Com_ParseFire: fire definition \"%s\" without body ignored\n",
name);
1688 if (
Q_streq(token,
"skill")) {
1701 Com_Printf(
"Com_ParseFire: unknown weapon skill \"%s\" ignored (weapon %s)\n", token,
name);
1702 }
else if (
Q_streq(token,
"effect")) {
1704 }
else if (
Q_streq(token,
"range")) {
1709 }
else if (
Q_streq(token,
"splrad")) {
1715 Com_Printf(
"Com_ParseFire: unknown token \"%s\" ignored (weapon %s)\n", token,
name);
1720 Com_Printf(
"Com_ParseFire: firedef for weapon \"%s\" has an invalid impact sound attenuation value set\n",
name);
1723 Com_Printf(
"Com_ParseFire: firedef for weapon \"%s\" has an invalid fire sound attenuation value set\n",
name);
1726 Com_Printf(
"Com_ParseFire: firedef for weapon \"%s\" doesn't have a skill set\n",
name);
1729 Com_Printf(
"Com_ParseFire: firedef for weapon \"%s\" has delayBetweenShots set but is only a one-shot-firedef\n",
name);
1733 if (fd->
name ==
nullptr) {
1749 const char* errhead =
"Com_ParseArmourOrResistance: unexpected end of file";
1754 if (!*text || *token !=
'{') {
1755 Com_Printf(
"Com_ParseArmourOrResistance: armour definition \"%s\" without body ignored\n",
name);
1767 for (
i = 0;
i <
csi.numDTs;
i++) {
1774 Sys_Error(
"Com_ParseArmourOrResistance: You try to set a rating value for a none menu displayed damage type '%s'",
1777 ad[
i] = atoi(token);
1782 if (
i >=
csi.numDTs)
1783 Com_Printf(
"Com_ParseArmourOrResistance: unknown damage type \"%s\" ignored (in %s)\n", token,
name);
1809 Sys_Error(
"max weapons per objdef exceeded");
1813 if (!*text || *token !=
'{') {
1814 Com_Printf(
"Com_ParseFireDefinition: weapon_mod \"%s\" without body ignored\n",
name);
1820 if (!*text || !
Q_streq(token,
"weapon")) {
1821 Com_Printf(
"Com_ParseFireDefinition: weapon_mod \"%s\" weapon as first element expected.\n",
name);
1836 const char* errhead =
"Com_ParseFireDefinition: unexpected end of file (weapon_mod ";
1843 if (
Q_streq(token,
"firedef")) {
1861 Com_Printf(
"Unknown token '%s' - expected firedef\n", token);
1872 Com_Printf(
"Com_ParseObjDefEffect: ignore invalid item effect stage for item: '%s'\n",
name);
1877 Com_Printf(
"Com_ParseObjDefEffect: there is already a strengthen effect assigned to: '%s'\n",
name);
1892 Com_Printf(
"Com_ParseItem: weapon def \"%s\" with same name found, second ignored\n",
name);
1897 Sys_Error(
"Com_ParseItem: MAX_OBJDEFS exceeded\n");
1913 Sys_Error(
"Com_ParseItem: no id given\n");
1915 od->
idx =
csi.numODs - 1;
1920 if (!*text || *token !=
'{') {
1921 Com_Printf(
"Com_ParseItem: weapon def \"%s\" without body ignored\n",
name);
1926 const char* errhead =
"Com_ParseItem: unexpected end of file (weapon ";
1937 if (
Q_streq(token,
"craftweapon")) {
1951 }
else if (
Q_streq(token,
"effect")) {
1953 }
else if (
Q_streq(token,
"crafttype")) {
1967 Com_Printf(
"AII_ParseAircraftItem: \"%s\" unknown craftitem type: \"%s\" - ignored.\n",
name, token);
1968 }
else if (
Q_streq(token,
"protection")) {
1970 }
else if (
Q_streq(token,
"rating")) {
1972 }
else if (
Q_streq(token,
"weapon_mod")) {
1975 Com_Printf(
"Com_ParseItem: unknown token \"%s\" ignored (weapon %s)\n", token,
name);
1984 if (od->
shape & (0x01010101 <<
i))
1998 Sys_Error(
"Item %s has invalid parameters\n", od->
id);
2002 Com_Printf(
"Com_ParseItem: weapon \"%s\" has an invalid reload sound attenuation value set\n", od->
id);
2022 Com_Printf(
"Com_ParseImplant: implant def \"%s\" with same name found, second ignored\n",
name);
2027 Sys_Error(
"Com_ParseImplant: MAX_IMPLANTS exceeded\n");
2036 Sys_Error(
"Com_ParseImplant: no id given\n");
2038 implant->
idx =
csi.numImplants - 1;
2043 if (!*text || *token !=
'{') {
2044 Com_Printf(
"Com_ParseImplant: implant def \"%s\" without body ignored\n",
name);
2049 const char* errhead =
"Com_ParseImplant: unexpected end of file (implant ";
2061 Com_Printf(
"Com_ParseImplant: syntax error (implant %s)\n",
name);
2066 Com_Printf(
"Com_ParseImplant: unknown token \"%s\" ignored (implant %s)\n", token,
name);
2071 if (implant->
item ==
nullptr) {
2133 Sys_Error(
"Unknown inventory definition \"%s\". Aborting.\n",
name);
2138 if (!strncmp(
name,
csi.ids[cid].name,
sizeof(
csi.ids[cid].name))) {
2139 Com_Printf(
"Com_ParseInventory: inventory def \"%s\" with same name found, second ignored\n",
name);
2182 const char* errhead =
"Com_ParseEquipment: unexpected end of file (equipment ";
2186 for (
i = 0;
i <
csi.numEDs;
i++)
2190 if (
i <
csi.numEDs) {
2191 Com_Printf(
"Com_ParseEquipment: equipment def \"%s\" with same name found, second ignored\n",
name);
2196 Sys_Error(
"Com_ParseEquipment: MAX_EQUIPDEFS exceeded\n");
2208 if (!*text || *token !=
'{') {
2209 Com_Printf(
"Com_ParseEquipment: equipment def \"%s\" without body ignored\n",
name);
2216 if (!*text || *token ==
'}')
2223 Com_Error(
ERR_DROP,
"Com_ParseEquipment: error while reading equipment item tuple");
2226 Com_Error(
ERR_DROP,
"Com_ParseEquipment: equipment item tuple must contains 2 elements (id amount)");
2228 const char* itemToken = (
char*)list->
data;
2229 const char* amountToken = (
char*)list->
next->
data;
2234 const int n = atoi(amountToken);
2236 Com_Printf(
"Com_ParseEquipment: item '%s' is used several times in def '%s'. Only last entry will be taken into account.\n",
2241 Com_Printf(
"Com_ParseEquipment: unknown token \"%s\" ignored (equipment %s)\n", itemToken,
name);
2244 }
else if (
Q_streq(token,
"aircraft")) {
2247 Com_Error(
ERR_DROP,
"Com_ParseEquipment: error while reading equipment aircraft tuple");
2250 Com_Error(
ERR_DROP,
"Com_ParseEquipment: equipment aircraft tuple must contains 2 elements (id amount)");
2252 const char* aircraftToken = (
char*)list->
data;
2253 const char* amountToken = (
char*)list->
next->
data;
2257 const int n = atoi(amountToken);
2259 Com_Printf(
"Com_ParseEquipment: aircraft type '%i' is used several times in def '%s'. Only last entry will be taken into account.\n",
2265 Sys_Error(
"unknown token in equipment in definition %s: '%s'", ed->
id, token);
2291 Sys_Error(
"Could not find any valid name definitions for category '%s'\n", td->
id);
2304 for (
int j = 0; j <
name; j++) {
2310 return (
const char*)list->
data;
2322 Com_Printf(
"Com_GiveModel: no models defined for gender %i and category '%s'\n", gender, td->
id);
2327 size_t n = rand() % td->
numModels[gender];
2348 for (
int i = 0;
i <
csi.numTeamDefs;
i++) {
2354 Com_Printf(
"Com_GetTeamDefinitionByID: could not find team definition for '%s' in team definitions\n", team);
2386 for (gender = 0; gender <
NAME_LAST; ++gender)
2388 numModels += teamDef->
numModels[gender];
2391 int roll = rand() % numModels;
2392 for (gender = 0; gender <
NAME_LAST; ++gender)
2394 if (roll < teamDef->numModels[gender])
2416 Com_Error(
ERR_DROP,
"Com_GetCharacterValues: could not find team '%s' in team definitions", teamDefition);
2444 Com_Error(
ERR_DROP,
"Could not set character values for team '%s'\n", teamDefition);
2454 const char* errhead =
"Com_ParseNames: unexpected end of file (names ";
2459 Com_Printf(
"Com_ParseActorNames: Name list with same name found, second ignored '%s'\n",
name);
2469 if (!*text || *token !=
'{') {
2470 Com_Printf(
"Com_ParseActorNames: names def \"%s\" without body ignored\n",
name);
2483 if (nameType == -1) {
2492 for (
linkedList_t* element = list; element !=
nullptr; element = element->
next) {
2494 const char* n = (
char*)element->data;
2514 Sys_Error(
"Com_ParseNames: '%s' has no female lastname category\n", nameList.
id);
2516 Sys_Error(
"Com_ParseNames: '%s' has no male lastname category\n", nameList.
id);
2518 Sys_Error(
"Com_ParseNames: '%s' has no neutral lastname category\n", nameList.
id);
2530 const char* errhead =
"Com_ParseActorModels: unexpected end of file (actors ";
2535 if (!*text || *token !=
'{') {
2536 Com_Printf(
"Com_ParseActorModels: actor def \"%s\" without body ignored\n", td->
id);
2549 if (nameType == -1) {
2559 Com_Error(
ERR_DROP,
"Com_ParseActorModels: model tuple must contains 5 elements");
2563 const char* pathToken = (
const char*)element->
data;
2564 element = element->
next;
2565 const char* bodyToken = (
const char*)element->
data;
2566 element = element->
next;
2567 const char* headToken = (
const char*)element->
data;
2568 element = element->
next;
2569 const char* bodySkinToken = (
const char*)element->
data;
2570 element = element->
next;
2571 const char* headSkinToken = (
const char*)element->
data;
2577 model.
bodySkin = atoi(bodySkinToken);
2578 model.
headSkin = atoi(headSkinToken);
2594 const char*
const errhead =
"Com_ParseActorSounds: unexpected end of file (actorsounds ";
2600 if (!*text || *token !=
'{') {
2601 Com_Printf(
"Com_ParseActorSounds: actorsounds def \"%s\" without body ignored\n",
name);
2628 if (
Q_streq(token,
"hurtsound")) {
2634 }
else if (
Q_streq(token,
"deathsound")) {
2641 Com_Printf(
"Com_ParseActorSounds: unknown token \"%s\" ignored (actorsounds %s)\n", token,
name);
2648 Com_Printf(
"Com_ParseActorSounds: unknown token \"%s\" ignored (actorsounds %s)\n", token,
name);
2658 Com_Printf(
"Com_GetBodyTemplateByID: could not find template: '%s'\n",
id);
2667 Com_Printf(
"Com_GetNameListByID: could not find name list: '%s'\n",
id);
2690 const char* errhead =
"Com_ParseTeam: unexpected end of file (team ";
2694 for (
i = 0, td =
csi.teamDef;
i <
csi.numTeamDefs;
i++, td++)
2699 if (
i ==
csi.numTeamDefs) {
2703 td->
idx =
csi.numTeamDefs;
2706 Com_Printf(
"CL_ParseTeam: Too many team definitions, '%s' ignored.\n",
name);
2710 Com_Printf(
"CL_ParseTeam: Team with same name found, second ignored '%s'\n",
name);
2722 if (!*text || *token !=
'{') {
2723 Com_Printf(
"Com_ParseTeam: team def \"%s\" without body ignored\n",
name);
2724 if (
csi.numTeamDefs - 1 == td -
csi.teamDef)
2738 if (
Q_streq(token,
"onlyWeapon")) {
2747 Sys_Error(
"Com_ParseTeam: Could not get item definition for '%s'", token);
2748 }
else if (
Q_streq(token,
"templates")) {
2754 for (
linkedList_t* element = list; element !=
nullptr; element = element->
next) {
2757 Com_Printf(
"Com_ParseTeam: template %s used more than once in team def %s second ignored", (
char*)element->data,
name);
2766 Sys_Error(
"Com_ParseTeam: Could not get character template for '%s' in %s", (
char*)element->data,
name);
2771 }
else if (
Q_streq(token,
"bodytype")) {
2775 Sys_Error(
"Com_ParseTeam: Could not find body type %s in team def %s\n", token,
name);
2777 }
else if (
Q_streq(token,
"names")) {
2780 if (nameList ==
nullptr)
2781 Sys_Error(
"Com_ParseTeam: Could not find name list %s in team def %s\n", token,
name);
2784 }
else if (
Q_streq(token,
"models"))
2786 else if (
Q_streq(token,
"actorsounds"))
2788 else if (
Q_streq(token,
"resistance"))
2791 Com_Printf(
"Com_ParseTeam: unknown token \"%s\" ignored (team %s)\n", token,
name);
2801 Sys_Error(
"Teamdef without body data: %s\n", td->
id);
2815 for (
int i = 0;
i <
csi.numChrTemplates;
i++)
2817 return &
csi.chrTemplates[
i];
2819 Com_Printf(
"Com_GetCharacterTemplateByID: could not find character template: '%s'\n", chrTemplate);
2839 for (
int i = 0;
i <
csi.numUGV;
i++) {
2841 Com_Printf(
"Com_ParseUGVs: ugv \"%s\" with same name already loaded\n",
name);
2847 Com_Printf(
"Com_ParseUGVs: Too many UGV descriptions, '%s' ignored.\n",
name);
2867 const char* errhead =
"Com_ParseCharacterTemplate: unexpected end of file";
2870 for (
i = 0;
i <
csi.numChrTemplates;
i++)
2872 Com_Printf(
"Com_ParseCharacterTemplate: Template with same name found, second ignored '%s'\n",
name);
2877 Sys_Error(
"Com_ParseCharacterTemplate: too many character templates");
2887 if (!*text || *token !=
'{') {
2888 Com_Printf(
"Com_ParseCharacterTemplate: character template \"%s\" without body ignored\n",
name);
2889 csi.numChrTemplates--;
2895 if (!*text || *token ==
'}')
2913 ct->
rate = atof(token);
2915 Com_Printf(
"Com_ParseCharacterTemplate: unknown token \"%s\" ignored (template %s)\n", token,
name);
2930 "accuracy",
"shooting_tu",
"movement_tu",
"detection",
"reaction_time",
"max_tu"
2935 const char* errhead =
"Com_ParseBodyPart: unexpected end of file";
2940 Com_Printf(
"Com_ParseBodyPart: BodyPart with same name found, second ignored '%s'\n",
name);
2946 Com_Printf(
"Com_ParseBodyPart: too many BodyParts '%s' ignored ('%s')\n",
name, bd->
id());
2955 if (!*text || *token !=
'{') {
2956 Com_Printf(
"Com_ParseBodyPart: BodyPart '%s' without body ignored\n",
name);
2962 if (!*text || *token ==
'}')
2966 if (
Q_streq(token,
"penalty")) {
2981 element = element->
next;
2987 Com_Printf(
"Com_ParseBodyPart: Unknown penalty '%s' ignored ('%s')\n",
static_cast<const char*
>(element->
data),
name);
2991 Com_Printf(
"Com_ParseBodyPart: Unknown token '%s' ignored ('%s')\n", token,
name);
3001 const char* errhead =
"Com_ParseBodyTemplate: unexpected end of file";
3006 Com_Printf(
"Com_ParseBodyTemplate: BodyTemplate with same name found, second ignored '%s'\n",
name);
3013 if (!*text || *token !=
'{') {
3014 Com_Printf(
"Com_ParseBodyTemplate: body template '%s' without body ignored\n",
name);
3022 if (!*text || *token ==
'}')
3025 if (
Q_streq(token,
"bodypart")) {
3032 Com_Printf(
"Com_ParseBodyTemplate: unknown token '%s' ignored ('%s')\n", token,
name);
3037 Com_Printf(
"Body template without bodyparts %s ignored!\n",
name);
3050#define TERRAIN_HASH_SIZE 64
3069 assert(textureName);
3072 if (
Q_streq(textureName, t->texture))
3088 Com_Printf(
"Terrain definition with same name already parsed: '%s'\n",
name);
3121 const char* errhead =
"Com_ParseGameTypes: unexpected end of file (gametype ";
3126 if (!*text || *token !=
'{') {
3127 Com_Printf(
"Com_ParseGameTypes: gametype \"%s\" without body ignored\n",
name);
3132 for (
i = 0;
i <
csi.numGTs;
i++)
3136 if (
i ==
csi.numGTs) {
3138 Sys_Error(
"Com_ParseGameTypes: MAX_GAMETYPES exceeded");
3143 Sys_Error(
"Com_ParseGameTypes: Too many gametypes.");
3153 if (!
Q_streq(token,
"cvarlist"))
3154 Sys_Error(
"Com_ParseGameTypes: gametype \"%s\" without cvarlist",
name);
3160 Sys_Error(
"Com_ParseGameTypes: gametype \"%s\" without cvarlist",
name);
3164 if (!*text || *token ==
'}') {
3166 Sys_Error(
"Com_ParseGameTypes: gametype \"%s\" with empty cvarlist",
name);
3173 Sys_Error(
"Com_ParseGameTypes: gametype \"%s\" max cvarlist hit",
name);
3176 if (!*text || *token ==
'}')
3177 Sys_Error(
"Com_ParseGameTypes: gametype \"%s\" cvar \"%s\" with no value",
name, cvarlist->
name);
3179 }
while (*text && *token !=
'}');
3183 Com_Printf(
"Com_ParseGameTypes: gametype \"%s\" with same already exists - ignore the second one\n",
name);
3196 const char* errhead =
"Com_ParseDamageTypes: unexpected end of file (damagetype ";
3202 if (!*text || *token !=
'{') {
3203 Com_Printf(
"Com_ParseDamageTypes: damage type list \"%s\" without body ignored\n",
name);
3215 if (*token ==
'_') {
3217 csi.dts[
csi.numDTs].showInMenu =
true;
3221 for (
i = 0;
i <
csi.numDTs;
i++)
3226 if (
i ==
csi.numDTs) {
3231 csi.damNormal =
csi.numDTs;
3232 else if (
Q_streq(token,
"blast"))
3233 csi.damBlast =
csi.numDTs;
3234 else if (
Q_streq(token,
"fire"))
3235 csi.damFire =
csi.numDTs;
3236 else if (
Q_streq(token,
"shock"))
3237 csi.damShock =
csi.numDTs;
3238 else if (
Q_streq(token,
"laser"))
3239 csi.damLaser =
csi.numDTs;
3240 else if (
Q_streq(token,
"plasma"))
3241 csi.damPlasma =
csi.numDTs;
3242 else if (
Q_streq(token,
"particlebeam"))
3243 csi.damParticle =
csi.numDTs;
3244 else if (
Q_streq(token,
"stun_electro"))
3245 csi.damStunElectro =
csi.numDTs;
3246 else if (
Q_streq(token,
"stun_gas"))
3247 csi.damStunGas =
csi.numDTs;
3248 else if (
Q_streq(token,
"smoke"))
3249 csi.damSmoke =
csi.numDTs;
3250 else if (
Q_streq(token,
"incendiary"))
3251 csi.damIncendiary =
csi.numDTs;
3255 Sys_Error(
"Com_ParseDamageTypes: Too many damage types.");
3257 Com_Printf(
"Com_ParseDamageTypes: damage type \"%s\" in list \"%s\" with same already exists - ignore the second one (#%i)\n", token,
name,
csi.numDTs);
3279 return va(
"+%s", craftID);
3287 if (
Q_streq(craftID,
"craft_drop_firebird"))
3288 return "+craft_crash_drop_firebird";
3289 else if (
Q_streq(craftID,
"craft_drop_raptor"))
3290 return "+craft_crash_drop_raptor";
3291 else if (
Q_streq(craftID,
"craft_inter_dragon"))
3292 return "+craft_crash_inter_dragon";
3293 else if (
Q_streq(craftID,
"craft_inter_saracen"))
3294 return "+craft_crash_inter_saracen";
3295 else if (
Q_streq(craftID,
"craft_inter_starchaser"))
3296 return "+craft_crash_inter_starchaser";
3312 return aircraftType;
3367 for (
int i = 0;
i <
csi.numUGV;
i++) {
3386 Com_Printf(
"Com_GetUGVByID Called with nullptr ugvID!\n");
3388 Com_Printf(
"Com_GetUGVByID: No ugv_t entry found for id '%s' in %i entries.\n", ugvID,
csi.numUGV);
3399 const int weaponsIdx = parse->numWeapons;
3400 const char*
id = parse->token;
3404 if (!parse->od->weapons[weaponsIdx]) {
3405 Sys_Error(
"Com_AddObjectLinks: Could not get item '%s' for linking into item '%s'\n",
3406 id , parse->od->id);
3410 for (
int k = 0; k < parse->od->numFiredefs[weaponsIdx]; k++) {
3411 parse->od->fd[weaponsIdx][k].obj = parse->od;
3423 for (
i = 0, od =
csi.ods;
i <
csi.numODs;
i++, od++) {
3427 for (
int n = 0; n <
csi.numODs; n++) {
3475 const char* errhead =
"Com_ParseMapDefinition: unexpected end of file (mapdef ";
3480 if (!*text || *token !=
'{') {
3481 Com_Printf(
"Com_ParseMapDefinition: mapdef \"%s\" without body ignored\n",
name);
3488 Sys_Error(
"Com_ParseMapDefinition: Max mapdef hit");
3504 if (
Q_streq(token,
"params")) {
3507 Com_Printf(
"Com_ParseMapDefinition: unknown token \"%s\" ignored (mapdef %s)\n", token,
name);
3514 Com_Printf(
"Com_ParseMapDefinition: mapdef \"%s\" with no map\n",
name);
3519 Com_Printf(
"Com_ParseMapDefinition: mapdef \"%s\" with no description\n",
name);
3524 Com_Printf(
"Com_ParseMapDefinition: mapdef \"%s\" with invalid maxAlien value\n",
name);
3537 const char* errhead =
"Com_ParseTerrainDefinition: unexpected end of file (terraindef ";
3545 if (!*text || *token !=
'{') {
3546 Com_Printf(
"Com_ParseTerrainDefinition: mapdef \"%s\" without body ignored\n",
name);
3563 if (kvp.
isKey(
"rgbred"))
3565 else if (kvp.
isKey(
"rgbgreen"))
3567 else if (kvp.
isKey(
"rgbblue"))
3569 else if (kvp.
isKey(
"survivalchance"))
3571 else if (kvp.
isKey(
"rainchance"))
3573 else if (kvp.
isKey(
"snowchance"))
3576 Com_Printf(
"Com_ParseTerrainDefinition: unknown token \"%s\" ignored (terraindef %s)\n", token,
name);
3581 Com_Printf(
"Com_ParseTerrainDefinition: terraindef \"%s\" with no name\n",
name);
3584 if (!
csi.terrainDefs.add(tDef))
3585 Com_Printf(
"Com_ParseTerrainDefinition: could not add terraindef \"%s\". Duplicate colors or name.\n",
name);
3623 Com_Printf(
"\n----------- parse scripts ----------\n");
3627 csi.damNormal =
csi.damBlast =
csi.damFire =
csi.damShock =
csi.damLaser =
csi.damPlasma =
csi.damParticle =
csi.damStunElectro =
csi.damStunGas =
NONE;
3638 const char* text =
nullptr;
3676 else if (!onlyServer)
3681 Sys_Error(
"Could not find version string for script files");
3709 Com_Printf(
"Shared Client/Server Info loaded\n");
3712 Com_Printf(
"...%3i equipment definitions parsed\n",
csi.numEDs);
3713 Com_Printf(
"...%3i inventory definitions parsed\n",
csi.numIDs);
3714 Com_Printf(
"...%3i team definitions parsed\n",
csi.numTeamDefs);
3719 static int checksum = 0;
void Sys_Backtrace(void)
On platforms supporting it, print a backtrace.
#define MAX_CHARACTER_TEMPLATES
#define ABILITY_NUM_TYPES
CGAME_HARD_LINKED_FUNCTIONS linkedList_t * LIST_Add(linkedList_t **listDest, void const *data, size_t length)
bool CL_ParseClientData(const char *type, const char *name, const char **text)
Called at client startup.
Header for certain screen operations.
void setId(const char *id)
void addBodyPart(const BodyPartData &bodyPart)
short numBodyParts(void) const
const char * id(void) const
int penalties[MODIFIER_MAX]
A pair of strings representing a key and a value The value string can be trimmed and rendered in the ...
bool isKey(const char *name) const
Terrain property table entry Terrain is defined by the file map_earth_terrain.png in pics/geoscape....
void Com_DPrintf(int level, const char *fmt,...)
A Com_Printf that only shows up if the "developer" cvar is set.
void Com_Error(int code, const char *fmt,...)
memPool_t * com_aliasSysPool
void Com_Printf(const char *const fmt,...)
memPool_t * com_genericPool
const char *const air_slot_type_strings[]
#define ACTOR_SIZE_NORMAL
#define ACTOR_SIZE_INVALID
const char * FS_GetFileData(const char *files)
Returns the buffer of a file.
char * FS_NextScriptHeader(const char *files, const char **name, const char **text)
int FS_BuildFileList(const char *fileList)
Build a filelist.
void Sys_Error(const char *error,...)
const objDef_t * INVSH_GetItemByIDX(int index)
Returns the item that belongs to the given index or nullptr if the index is invalid.
const objDef_t * INVSH_GetItemByID(const char *id)
Returns the item that belongs to the given id or nullptr if it wasn't found.
void INVSH_InitCSI(const csi_t *import)
Initializes client server shared data pointer. This works because the client and the server are both ...
const objDef_t * INVSH_GetItemByIDSilent(const char *id)
Returns the item that belongs to the given id or nullptr if it wasn't found.
int32_t weaponFireDefIndex_t
#define MAX_AMMOS_PER_OBJDEF
aircraftItemType_t
All different types of craft items.
#define SHAPE_SMALL_MAX_WIDTH
The max width and height of an item-shape.
#define MAX_FIREDEFS_PER_WEAPON
short humanAircraftType_t
#define SHAPE_BIG_MAX_WIDTH
32 bit mask
#define SHAPE_BIG_MAX_HEIGHT
defines the max height of an inventory container
#define SHAPE_SMALL_MAX_HEIGHT
#define MAX_WEAPONS_PER_OBJDEF
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
void LIST_AddString(linkedList_t **listDest, const char *data)
Adds an string to a new or to an already existing linked list. The string is copied here.
void LIST_Delete(linkedList_t **list)
int LIST_Count(const linkedList_t *list)
#define LIST_Foreach(list, type, var)
Iterates over a linked list, it's safe to delete the returned entry from the list while looping over ...
unsigned Com_BlockChecksum(const void *buffer, int length)
#define Mem_PoolStrDup(in, pool, tagNum)
#define Mem_PoolStrDupTo(in, out, pool, tagNum)
#define Mem_AllocType(type)
#define Mem_PoolAllocType(type, pool)
const char * Com_Parse(const char *data_p[], char *target, size_t size, bool replaceWhitespaces)
Parse a token out of a string.
void Com_SkipBlock(const char **text)
Skips a block of {} in our script files.
const char * Com_GetToken(const char **data_p)
Get the current token value.
void Com_UnParseLastToken(void)
Put back the last token into the parser The next call of Com_Parse will return the same token again.
Com_TokenType_t Com_NextToken(const char **data_p)
Compute the next token.
Shared parsing functions.
#define MapDef_Foreach(var)
#define MAX_CVARLISTINGAMETYPE
static wrapCache_t * hash[MAX_WRAP_HASH]
QGL_EXTERN GLuint GLchar GLuint * len
QGL_EXTERN int GLboolean GLfloat * v
QGL_EXTERN GLint GLenum type
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
static const value_t ugvValues[]
static void Com_ParseDamageTypes(const char *name, const char **text)
bool Com_ParseBoolean(const char *token)
Parses a boolean from a string.
static int Com_FindNameType(const char *nameType)
static const char *const penaltyNames[MODIFIER_MAX]
const char *const vt_names[]
possible values for parsing functions
static void Com_ParseFireEffect(fireDef_t *fd, const char *name, const char **text)
Parses the effect that is bound to a fire definitions.
static void Com_ParseItem(const char *name, const char **text)
Parses weapon, equipment, craft items and armour.
int Com_SetValue(void *base, const void *set, valueTypes_t type, int ofs, size_t size)
static void Com_ParseActorSounds(const char *name, const char **text, teamDef_t *td)
Parses "actorsounds" definition from team_* ufo script files.
bool Com_ParseBlock(const char *name, const char **text, void *base, const value_t *values, memPool_t *mempool)
const teamDef_t * Com_GetTeamDefinitionByID(const char *team)
Returns the teamDef pointer for the searched team id - or nullptr if not found in the teamDef array.
static void Com_ParseObjDefEffect(objDef_t *od, const char *name, const char **text)
static const char * Com_GiveName(int gender, const teamDef_t *td)
const char *const blend_names[]
void Com_ParseScripts(bool onlyServer)
static short Com_GetCrashedAircraftIdNum(aircraftType_t type, const char *idString)
static short Com_GetAircraftIdNum(aircraftType_t type, const char *idString)
static const char **const aircraftIdsTable[CRAFT_MAX]
static void Com_ParseMapDefinition(const char *name, const char **text)
static const size_t vt_sizes[]
target sizes for buffer
static void Com_ParseFireDefinition(objDef_t *od, const char *name, const char **text)
static const char *const craftTypeIds[CRAFT_MAX *2]
const char *const name_strings[NAME_NUM_TYPES]
static void Com_ParseTerrainDefinition(const char *name, const char **text)
static void Com_ParseActorModels(const char *name, const char **text, teamDef_t *td)
Parses "actors" definition from team_* ufo script files.
static void Com_ParseAircraftNames(const char *const name, const char **text)
Parse the aircraft names from the scripts.
static const char * dropIdsTable[DROPSHIP_MAX]
const char * Com_GetRandomMapAssemblyNameForCrashedCraft(const char *craftID)
const char * Com_EParse(const char **text, const char *errhead, const char *errinfo, char *target, size_t size)
Parsing function that prints an error message when there is no text in the buffer.
static void Com_GetAircraftIdStr(aircraftType_t type, short idNum, char *outStr, const size_t size)
static const teamNames_t * Com_GetNameListByID(const char *id)
int Com_GetMapDefNumber(void)
static const value_t fdps[]
static short aircraftIdsNum[CRAFT_MAX]
mapDef_t * Com_GetMapDefByIDX(int index)
static void Com_ParseEquipment(const char *name, const char **text)
void Com_RegisterConstInt(const char *name, int value)
Register mappings between script strings and enum values for values of the type V_INT.
static void Com_ParseVersion(const char *version)
static void Com_ParseCharacterTemplate(const char *name, const char **text)
Parses character templates from scripts.
mapDef_t * Com_GetMapDefinitionByID(const char *mapDefID)
static const value_t terrainTypeValues[]
static void Com_ParseTeam(const char *name, const char **text)
static ufoType_t Com_GetUfoIdNum(const char *idString)
const char * Com_UFOCrashedTypeToShortName(ufoType_t type)
Translate UFO type to short name when UFO is crashed.
static const value_t equipment_definition_vals[]
Valid equipment definition values from script files.
bool Com_ParseBlockToken(const char *name, const char **text, void *base, const value_t *values, memPool_t *mempool, const char *token)
static bool versionParsed
const char * Com_GetRandomMapAssemblyNameForCraft(const char *craftID)
Returns the name of an aircraft or an ufo that is used in the ump files for the random map assembly.
static char parseErrorMessage[256]
static short Com_GetHumanCraftIdNum(const char *idString)
static const char * interIdsTable[INTERCEPTOR_MAX]
const ugv_t * Com_GetUGVByIDSilent(const char *ugvID)
Searches an UGV definition by a given script id and returns the pointer to the global data.
static void Com_ParseBodyPart(const char *name, const char **text, BodyData *bd)
static terrainType_t * terrainTypesHash[TERRAIN_HASH_SIZE]
const chrTemplate_t * Com_GetCharacterTemplateByID(const char *chrTemplate)
Returns the chrTemplate pointer for the given id - or nullptr if not found in the chrTemplates array.
const char * Com_GetLastParseError(void)
static int Com_GetGender(const teamDef_t *teamDef)
Return a random (weighted by number of models) gender for this teamDef.
bool Com_UnregisterConstList(const constListEntry_t constList[])
Unregisters a list of string aliases.
int Com_GetScriptChecksum(void)
static const value_t bodyPartValues[]
bool Com_UnregisterConstVariable(const char *name)
Removes a registered constant from the script mapping hash table.
static const value_t implant_vals[]
static void Com_ParseInventory(const char *name, const char **text)
short Com_GetHumanAircraftIdsNum(void)
short Com_GetDropShipIdsNum(void)
ufoType_t Com_UFOShortNameToID(const char *token)
Translate short name to UFO type.
bool Com_GetCharacterModel(character_t *chr)
const terrainType_t * Com_GetTerrainType(const char *textureName)
Searches the terrain definition if given.
const char *const fade_names[]
bool Com_GetConstIntFromNamespace(const char *space, const char *variable, int *value)
Searches whether a given value was registered as a string to int mapping.
#define CONSTNAMEINT_HASH_SIZE
const ugv_t * Com_GetUGVByID(const char *ugvID)
Searches an UGV definition by a given script id and returns the pointer to the global data.
static void Com_ParseUGVs(const char *name, const char **text)
Parse 2x2 units (e.g. UGVs).
static const value_t teamDefValues[]
possible teamdesc values (ufo-scriptfiles)
static com_constNameInt_t * com_constNameInt
Linked list of all the registeres mappings.
static linkedList_t * parseItemWeapons
Temporary list of weapon ids as parsed from the ufo file "weapon_mod <id>" in Com_ParseItem and use...
short Com_GetUfoIdsNum(void)
void Com_GetCharacterValues(const char *teamDefition, character_t *chr)
Assign character values, 3D models and names to a character.
static const value_t gameTypeValues[]
possible gametype values for the gameserver (ufo-scriptfiles)
static void Com_AddObjectLinks(void)
Creates links to other items (i.e. ammo<->weapons).
static ufoType_t Com_GetCrashedUfoIdNum(const char *idString)
static const BodyData * Com_GetBodyTemplateByID(const char *id)
static void Com_ParseBodyTemplate(const char *name, const char **text)
#define MAX_CONSTNAMEINT_NAME
bool Com_GetConstInt(const char *name, int *value)
Searches whether a given value was registered as a string to int mapping.
static const value_t od_vals[]
static const char * Com_GetAircraftDef(aircraftType_t type, short idNum)
static void Com_GetCrashedAircraftIdStr(aircraftType_t type, short idNum, char *outStr, const size_t size)
static bool Com_ParseFire(const char *name, const char **text, fireDef_t *fd)
Parses the firemode.
static void Com_ParseTerrain(const char *name, const char **text)
Parses "terrain" definition from script files.
#define TERRAIN_HASH_SIZE
static const value_t idps[]
humanAircraftType_t Com_DropShipShortNameToID(const char *token)
Translate DropShip type to short name.
bool Com_ParseList(const char **text, linkedList_t **list)
static const char * ufoIdsTable[UFO_MAX]
Ufoai uses two types of ids for aircraft: the string is used for references in the scripts,...
const char *const align_names[]
const char *const style_names[]
const char * Com_GetConstVariable(const char *space, int value)
Searches the mapping variable for a given integer value and a namespace.
const char * Com_ValueToStr(const void *base, const valueTypes_t type, const int ofs)
static const char *const skillNames[SKILL_NUM_TYPES+1]
static const value_t effect_vals[]
static teamDef_t::model_t const * Com_GiveModel(int gender, const teamDef_t *td)
const char * Com_UFOTypeToShortName(ufoType_t type)
Translate UFO type to short name.
const char * Com_DropShipTypeToShortName(humanAircraftType_t type)
Translate DropShip type to short name.
resultStatus_t Com_ParseValue(void *base, const char *token, valueTypes_t type, int ofs, size_t size, size_t *writtenBytes)
Parse a value from a string.
static void Com_ParseGameTypes(const char *name, const char **text)
static com_constNameInt_t * com_constNameInt_hash[CONSTNAMEINT_HASH_SIZE]
Hash of all the registeres mappings.
void Com_RegisterConstList(const constListEntry_t constList[])
Registers a list of string aliases.
static void Com_ParseImplant(const char *name, const char **text)
static const char * Com_ConstIntGetVariable(const char *name)
Will extract the variable from a string<=>int mapping string which contain a namespace.
static void Com_GetHumanCraftIdStr(short idNum, char *outStr, const size_t size)
static void Com_GetUfoIdStr(ufoType_t idNum, char *outStr, const size_t size)
static const size_t vt_aligns[]
natural align for each targets
void * Com_AlignPtr(const void *memory, valueTypes_t type)
Align a memory to use a natural address for the data type we will write.
static effectStages_t Com_ParseItemEffect(itemEffect_t *e, const char *name, const char **text)
Parses the item effect.
static void Com_GetCrashedUfoIdStr(ufoType_t idNum, char *outStr, const size_t size)
static const value_t mapdef_vals[]
valid mapdef descriptors
static void Com_ParseActorNames(const char *name, const char **text)
Parses "name" definition from team_* ufo script files.
static void Com_ParseArmourOrResistance(const char *name, const char **text, short *ad, bool rating)
Parses the armour definitions or the team resistance values from script files. The protection and rat...
int Com_EParseValue(void *base, const char *token, valueTypes_t type, int ofs, size_t size)
Header for script parsing functions.
align_t
We need this here for checking the boundaries from script values.
T & Com_GetValue(void *const object, value_t const *const value)
valueTypes_t
possible values for parsing functions
#define MEMBER_SIZEOF(TYPE, MEMBER)
#define SND_VOLUME_FOOTSTEPS
#define AIR_SLOT_TYPE_STRINGS
bool Q_strnull(const char *string)
unsigned int Com_HashKey(const char *name, int hashsize)
returns hash key for a string
void Q_strncpyz(char *dest, const char *src, size_t destsize)
Safe strncpy that ensures a trailing zero.
void Q_strcat(char *dest, size_t destsize, const char *format,...)
Safely (without overflowing the destination buffer) concatenates two strings.
char const * Q_strstart(char const *str, char const *start)
Matches the start of a string.
bool Com_sprintf(char *dest, size_t size, const char *fmt,...)
copies formatted string with buffer-size checking
const char * va(const char *format,...)
does a varargs printf into a temp buffer, so I don't need to have varargs versions of all text functi...
Describes a character with all its attributes.
const teamDef_t * teamDef
actorSizeEnum_t fieldSize
int skills[SKILL_NUM_TYPES+1][2]
Structure to map (script) strings and integer (enum) values.
struct com_constNameInt_s * next
char name[MAX_CONSTNAMEINT_NAME]
struct com_constNameInt_s * hash_next
list of script aliases to register
int numItems[MAX_OBJDEFS]
int numAircraft[AIRCRAFTTYPE_MAX]
this is a fire definition for our weapons/ammo
itemEffect_t * activeEffect
itemEffect_t * deactiveEffect
itemEffect_t * overdoseEffect
weaponFireDefIndex_t weapFdsIdx
cvarlist_t cvars[MAX_CVARLISTINGAMETYPE]
const struct objDef_s * item
inventory definition for our menus
Defines all attributes of objects used in the inventory.
const struct objDef_s * ammos[MAX_AMMOS_PER_OBJDEF]
fireDef_t fd[MAX_WEAPONS_PER_OBJDEF][MAX_FIREDEFS_PER_WEAPON]
fireDefIndex_t numFiredefs[MAX_WEAPONS_PER_OBJDEF]
itemEffect_t * strengthenEffect
short protection[MAX_DAMAGETYPES]
short ratings[MAX_DAMAGETYPES]
const struct objDef_s * weapons[MAX_WEAPONS_PER_OBJDEF]
short resistance[MAX_DAMAGETYPES]
const objDef_t * onlyWeapon
int numSounds[SND_MAX][NAME_LAST]
linkedList_t *const * names
linkedList_t * sounds[SND_MAX][NAME_LAST]
const chrTemplate_t * characterTemplates[MAX_TEMPLATES_PER_TEAM]
char deathTextureName[MAX_VAR]
linkedList_t * models[NAME_LAST]
const BodyData * bodyTemplate
linkedList_t * names[NAME_NUM_TYPES]
int numNames[NAME_NUM_TYPES]
Different terrain definitions for footsteps and particles.
struct terrainType_s * hash_next
Defines a type of UGV/Robot.
static const vec3_t scale