92static void AIR_ListAircraft_f (
void)
96 if (
cgi->Cmd_Argc() == 2) {
97 int baseIdx = atoi(
cgi->Cmd_Argv(1));
102 if (base && aircraft->homebase != base)
105 cgi->Com_Printf(
"Aircraft %s\n", aircraft->name);
106 cgi->Com_Printf(
"...idx global %i\n", aircraft->idx);
107 cgi->Com_Printf(
"...homebase: %s\n", aircraft->homebase ? aircraft->homebase->name :
"NO HOMEBASE");
108 for (
int i = 0;
i < aircraft->maxWeapons;
i++) {
111 cgi->Com_Printf(
"...weapon slot %i contains %s",
i, slot->
item->
id);
114 cgi->Com_Printf(
" (functional)\n");
123 cgi->Com_Printf(
"......this weapon is loaded with ammo %s\n", slot->
ammo->
id);
125 cgi->Com_Printf(
"......no more ammo (%s)\n", slot->
ammo->
id);
128 cgi->Com_Printf(
"......this weapon isn't loaded with ammo\n");
131 cgi->Com_Printf(
"...weapon slot %i is empty\n",
i);
135 if (aircraft->shield.item) {
136 cgi->Com_Printf(
"...armour slot contains %s", aircraft->shield.item->id);
137 if (!aircraft->shield.installationTime) {
138 cgi->Com_Printf(
" (functional)\n");
139 }
else if (aircraft->shield.installationTime > 0) {
140 cgi->Com_Printf(
" (%i hours before installation is finished)\n", aircraft->shield.installationTime);
142 cgi->Com_Printf(
" (%i hours before removing is finished)\n", aircraft->shield.installationTime);
145 cgi->Com_Printf(
"...armour slot is empty\n");
148 for (
int j = 0; j < aircraft->maxElectronics; j++) {
151 cgi->Com_Printf(
"...electronics slot %i contains %s", j, slot->
item->
id);
154 cgi->Com_Printf(
" (functional)\n");
161 cgi->Com_Printf(
"...electronics slot %i is empty\n", j);
165 if (aircraft->pilot) {
167 cgi->Com_Printf(
"...pilot: ucn: %i name: %s\n", chr->
ucn, chr->
name);
169 cgi->Com_Printf(
"...no pilot assigned\n");
172 cgi->Com_Printf(
"...damage: %i\n", aircraft->damage);
173 cgi->Com_Printf(
"...stats: ");
176 cgi->Com_Printf(
"%.2f ", aircraft->stats[k] / 1000.0f);
178 cgi->Com_Printf(
"%i ", aircraft->stats[k]);
181 cgi->Com_Printf(
"\n");
182 cgi->Com_Printf(
"...name %s\n", aircraft->id);
183 cgi->Com_Printf(
"...team size %i\n", aircraft->maxTeamSize);
184 cgi->Com_Printf(
"...fuel %i\n", aircraft->fuel);
186 cgi->Com_Printf(
"...pos %.0f:%.0f\n", aircraft->pos[0], aircraft->pos[1]);
187 cgi->Com_Printf(
"...team: (%i/%i)\n",
cgi->LIST_Count(aircraft->acTeam), aircraft->maxTeamSize);
190 cgi->Com_Printf(
".........name: %s (ucn: %i)\n", chr->
name, chr->
ucn);
193 if (aircraft->itemCargo) {
194 cgi->Com_Printf(
"...itemCargo:\n");
197 cgi->Com_Printf(
"......item: %s amount: %d loose amount: %d\n", item->objDef->id, item->amount, item->looseAmount);
199 cgi->LIST_Delete(&cargo);
202 if (aircraft->alienCargo) {
203 cgi->Com_Printf(
"...alienCargo:\n");
206 cgi->Com_Printf(
"......team: %s alive: %d dead: %d\n", item->teamDef->id, item->alive, item->dead);
208 cgi->LIST_Delete(&cargo);
222 if (aircraft ==
nullptr)
239 if (aircraft ==
nullptr)
262 while ((cont = soldierInventory->
getNextCont(cont))) {
306 aircraft->
mission->missionResults.itemTypes++;
307 aircraft->
mission->missionResults.itemAmount += item->amount;
309 if (item->amount > 0)
310 cgi->Com_DPrintf(
DEBUG_CLIENT,
"Collected item: %s amount: %i\n", item->objDef->id, item->amount);
313 cgi->LIST_Delete(&items);
315 items = previousCargo->
list();
317 aircraft->
itemCargo->
add(item->objDef, item->amount, item->looseAmount);
319 cgi->LIST_Delete(&items);
320 delete previousCargo;
335 return _(
"ON RED ALERT");
337 switch (aircraft->
status) {
339 return _(
"Nothing - should not be displayed");
343 return _(
"refuelling");
347 return _(
"in transit");
349 return _(
"enroute to mission");
351 return _(
"pursuing a UFO");
353 return _(
"ready to drop soldiers");
355 return _(
"intercepting a UFO");
357 return _(
"enroute to new home base");
359 return _(
"returning to base");
361 cgi->Com_Error(
ERR_DROP,
"AIR_CRASHED should not be visible anywhere");
388 switch (aircraft->
status) {
418 if (aircraft->tpl == aircraftTemplate)
435 return 10 * (
int) (111.2 * value / 10.0f);
559 for (
int i = 0;
i <
ccs.numAircraftTemplates;
i++) {
562 return aircraftTemplate;
576 cgi->Com_Error(
ERR_DROP,
"AIR_GetAircraft called with invalid name!");
577 else if (aircraft ==
nullptr)
632 if (
cgi->LIST_Remove(&
ccs.aircraft, (
const void*)aircraft)) {
633 if (base && capType !=
MAX_CAP && !crashed)
652 aircraft->
idx =
ccs.campaignStats.aircraftHad++;
673 aircraft->
radar.ufoDetectionProbability = aircraftTemplate->
radar.ufoDetectionProbability;
676 cgi->Com_DPrintf(
DEBUG_CLIENT,
"Adding new aircraft %s with IDX %i for %s\n", aircraft->
id, aircraft->
idx, base->
name);
681 cgi->Cmd_ExecuteString(
"base_init %d", base->
idx);
691 if (aircraft ==
nullptr)
695 if (building ==
nullptr)
711 while ((cont = employee->chr.inv.getNextCont(cont,
true))) {
712 Item* item =
nullptr;
737 return _(
"No operational hangars at that base.");
741 return _(
"No free hangars at that base.");
744 return _(
"Insufficient free crew quarter space at that base.");
747 return _(
"Insufficient storage space at that base.");
751 return _(
"That base is beyond this aircraft's range.");
766 Item* item =
nullptr;
794 cgi->Com_DPrintf(
DEBUG_CLIENT,
"AIR_MoveAircraftIntoNewHomebase: Change homebase of '%s' to '%s'\n", aircraft->
id, base->
name);
867 cgi->Cvar_Set(
"mn_aircraftinbase",
"0");
868 cgi->Cvar_Set(
"mn_aircraftname",
"");
869 cgi->Cvar_Set(
"mn_aircraft_model",
"");
875 cgi->Cmd_ExecuteString(
"base_init %d", base->
idx);
878 if (aircraftIsOnGeoscape)
907 cgi->Com_Error(
ERR_DROP,
"AIR_DestroyAircraft: Could not remove pilot from game: %s (ucn: %i)\n",
914 cgi->Com_Error(
ERR_DROP,
"AIR_DestroyAircraft: aircraft id %s had no pilot\n", aircraft->
id);
931 aircraft->
time += dt;
932 aircraft->
fuel -= dt;
942 const int p = (
int) frac;
960 const int p = (
int) frac;
980 switch (aircraft->
status) {
987 aircraft->
mission->active =
true;
992 cgi->UI_PushWindow(
"popup_intercept_ready");
993 cgi->UI_ExecuteConfunc(
"pop_intready_aircraft \"%s\" \"%s\"", aircraft->
name,
1001 _(
"Craft %s has returned to %s."), aircraft->
name, aircraft->
homebase->name);
1019 if (aircraft->
fuel < 0)
1033 int amLoad = amNextLevel - amCurrentLevel;
1035 if (amLoad > amAvailable) {
1038 amLoad = amAvailable;
1042 _(
"Craft %s couldn't be completely refueled at %s. Not enough antimatter."), aircraft->
name, aircraft->
homebase->name);
1052 aircraft->
fuel += fillup;
1058 _(
"Craft %s has refueled at %s."), aircraft->
name, aircraft->
homebase->name);
1077 static bool radarOverlayReset =
false;
1084 assert(aircraft->homebase);
1085 if (aircraft->status ==
AIR_IDLE) {
1087 aircraft->fuel -= dt;
1091 radarOverlayReset =
true;
1100 MS_AddNewMessage(
_(
"Notice"),
va(
_(
"Craft %s is low on fuel and must return to base."), aircraft->name));
1105 if (aircraft->status ==
AIR_UFO) {
1110 for (
int k = 0; k < aircraft->maxWeapons; k++) {
1123 radarOverlayReset =
false;
1135 if (aircraft->idx == aircraftIdx) {
1136 cgi->Com_DPrintf(
DEBUG_CLIENT,
"AIR_AircraftGetFromIDX: aircraft idx: %i\n", aircraft->idx);
1152 if (!aircraft || !mission)
1156 CP_Popup(
_(
"Notice"),
_(
"Assign one or more soldiers to this aircraft first."));
1174 cgi->UI_PushWindow(
"popup_baseattack");
1186 aircraft->
point = 0;
1278 const char* errhead =
"AIR_ParseAircraft: unexpected end of file (aircraft ";
1286 cgi->Com_Printf(
"AIR_ParseAircraft: too many aircraft definitions; def \"%s\" ignored\n",
name);
1290 if (!assignAircraftItems) {
1292 if (aircraftTemplateCheck) {
1293 cgi->Com_Printf(
"AIR_ParseAircraft: Second aircraft with same name found (%s) - second ignored\n",
name);
1298 aircraftTemplate = &
ccs.aircraftTemplates[
ccs.numAircraftTemplates];
1302 aircraftTemplate->
tpl = aircraftTemplate;
1313 aircraftTemplate->
radar.ufoDetectionProbability = 1.0f;
1315 ccs.numAircraftTemplates++;
1317 aircraftTemplate =
nullptr;
1318 for (
i = 0;
i <
ccs.numAircraftTemplates;
i++) {
1321 aircraftTemplate = aircraft;
1325 if (!aircraftTemplate)
1332 if (!*text || *token !=
'{') {
1333 cgi->Com_Printf(
"AIR_ParseAircraft: aircraft def \"%s\" without body ignored\n",
name);
1338 token =
cgi->Com_EParse(text, errhead,
name);
1345 token =
cgi->Com_EParse(text, errhead,
name);
1348 if (token[0] ==
'_')
1352 }
else if (
Q_streq(token,
"radar")) {
1353 token =
cgi->Com_EParse(text, errhead,
name);
1354 if (!*text || *token !=
'{') {
1355 cgi->Com_Printf(
"AIR_ParseAircraft: Invalid radar value for aircraft: %s\n",
name);
1359 token =
cgi->Com_EParse(text, errhead,
name);
1366 cgi->Com_Printf(
"AIR_ParseAircraft: Ignoring unknown radar value '%s'\n", token);
1370 if (assignAircraftItems) {
1373 if (*token ==
'{') {
1375 }
else if (
Q_streq(token,
"shield")) {
1376 token =
cgi->Com_EParse(text, errhead,
name);
1379 cgi->Com_DPrintf(
DEBUG_CLIENT,
"use shield %s for aircraft %s\n", token, aircraftTemplate->
id);
1383 }
else if (
Q_streq(token,
"slot")) {
1384 token =
cgi->Com_EParse(text, errhead,
name);
1385 if (!*text || *token !=
'{') {
1386 cgi->Com_Printf(
"AIR_ParseAircraft: Invalid slot value for aircraft: %s\n",
name);
1390 token =
cgi->Com_EParse(text, errhead,
name);
1397 token =
cgi->Com_EParse(text, errhead,
name);
1418 cgi->Com_Error(
ERR_DROP,
"Unknown value '%s' for slot type\n", token);
1419 }
else if (
Q_streq(token,
"position")) {
1420 token =
cgi->Com_EParse(text, errhead,
name);
1440 cgi->Com_Error(
ERR_DROP,
"Unknown value '%s' for slot position\n", token);
1441 }
else if (
Q_streq(token,
"contains")) {
1442 token =
cgi->Com_EParse(text, errhead,
name);
1450 cgi->Com_DPrintf(
DEBUG_CLIENT,
"use weapon %s for aircraft %s\n", token, aircraftTemplate->
id);
1454 cgi->Com_DPrintf(
DEBUG_CLIENT,
"use electronics %s for aircraft %s\n", token, aircraftTemplate->
id);
1457 cgi->Com_Printf(
"Ignoring item value '%s' due to unknown slot type\n", token);
1461 }
else if (
Q_streq(token,
"ammo")) {
1462 token =
cgi->Com_EParse(text, errhead,
name);
1469 cgi->Com_DPrintf(
DEBUG_CLIENT,
"use ammo %s for aircraft %s\n", token, aircraftTemplate->
id);
1471 cgi->Com_Printf(
"Ignoring ammo value '%s' due to unknown slot type\n", token);
1473 }
else if (
Q_streq(token,
"size")) {
1474 token =
cgi->Com_EParse(text, errhead,
name);
1480 else if (
Q_streq(token,
"medium"))
1482 else if (
Q_streq(token,
"heavy"))
1485 cgi->Com_Printf(
"Unknown size value for aircraft slot: '%s'\n", token);
1487 cgi->Com_Printf(
"Ignoring size parameter '%s' for non-weapon aircraft slots\n", token);
1489 cgi->Com_Printf(
"AIR_ParseAircraft: Ignoring unknown slot value '%s'\n", token);
1493 if (
Q_streq(token,
"shield")) {
1494 cgi->Com_EParse(text, errhead,
name);
1502 token =
cgi->Com_EParse(text, errhead,
name);
1503 if (!*text || *token !=
'{') {
1504 cgi->Com_Printf(
"AIR_ParseAircraft: Invalid slot value for aircraft: %s\n",
name);
1508 }
else if (
Q_streq(token,
"param")) {
1509 token =
cgi->Com_EParse(text, errhead,
name);
1510 if (!*text || *token !=
'{') {
1511 cgi->Com_Printf(
"AIR_ParseAircraft: Invalid param value for aircraft: %s\n",
name);
1515 token =
cgi->Com_EParse(text, errhead,
name);
1521 if (
Q_streq(token,
"range")) {
1523 token =
cgi->Com_EParse(text, errhead,
name);
1528 cgi->Com_Error(
ERR_DROP,
"AIR_ParseAircraft: speed value must be entered before range value");
1533 cgi->Com_Printf(
"AIR_ParseAircraft: Ignoring unknown param value '%s'\n", token);
1537 cgi->Com_Printf(
"AIR_ParseAircraft: unknown token \"%s\" ignored (aircraft %s)\n", token,
name);
1538 cgi->Com_EParse(text, errhead,
name);
1543 if (aircraftTemplate->
building ==
nullptr)
1544 aircraftTemplate->
setUfoType(
cgi->Com_UFOShortNameToID(aircraftTemplate->
id));
1551static void AIR_ListCraftIndexes_f (
void)
1553 cgi->Com_Printf(
"globalIDX\t(Craftname)\n");
1555 cgi->Com_Printf(
"%i\t(%s)\n", aircraft->idx, aircraft->name);
1562static void AIR_ListAircraftSamples_f (
void)
1564 int i = 0, max =
ccs.numAircraftTemplates;
1567 cgi->Com_Printf(
"%i aircraft\n", max);
1568 if (
cgi->Cmd_Argc() == 2) {
1569 max = atoi(
cgi->Cmd_Argv(1));
1570 if (max >=
ccs.numAircraftTemplates || max < 0)
1574 for (;
i < max;
i++) {
1576 cgi->Com_Printf(
"aircraft: '%s'\n", aircraftTemplate->
id);
1578 cgi->Com_Printf(
"..%s: %s\n", vp->
string,
cgi->Com_ValueToStr(aircraftTemplate, vp->
type, vp->
ofs));
1581 cgi->Com_Printf(
"..%s: %s\n", vp->
string,
cgi->Com_ValueToStr(aircraftTemplate, vp->
type, vp->
ofs));
1599 if (aircraft->mission == mission)
1619 }
else if (destroyed && (ufo < aircraft->aircraftTarget)) {
1620 aircraft->aircraftTarget--;
1626 while ((base =
B_GetNext(base)) !=
nullptr) {
1631 if (baseWeapon->
target == ufo)
1632 baseWeapon->
target =
nullptr;
1633 else if (destroyed && (baseWeapon->
target > ufo))
1638 if (baseWeapon->
target == ufo)
1639 baseWeapon->
target =
nullptr;
1640 else if (destroyed && (baseWeapon->
target > ufo))
1671 return pow(cos(a) - cos(speedRatio * a) * cos(c), 2.0f)
1672 - sin(c) * sin(c) * (sin(speedRatio * a) * sin(speedRatio * a) - sin(a) * sin(a) * sin(B) * sin(B));
1687 return 2. * (cos(a) - cos(speedRatio * a) * cos(c)) * (- sin(a) + speedRatio * sin(speedRatio * a) * cos(c))
1688 - sin(c) * sin(c) * (speedRatio * sin(2. * speedRatio * a) - sin(2. * a) * sin(B) * sin(B));
1703 const float BIG_STEP = 0.05f;
1705 const float PRECISION_ROOT = 0.000001f;
1706 const float MAXIMUM_VALUE_ROOT = 2.0f *
M_PI;
1708 float begin, end, middle;
1709 float fBegin, fEnd, fMiddle;
1710 float fdBegin, fdEnd, fdMiddle;
1713 end = start + PRECISION_ROOT / 10.0f;
1721 end = begin + BIG_STEP;
1722 if (end > MAXIMUM_VALUE_ROOT) {
1723 end = MAXIMUM_VALUE_ROOT;
1729 }
while (fBegin * fEnd > 0 && fdBegin * fdEnd > 0);
1731 if (fBegin * fEnd > 0) {
1732 if (fdBegin * fdEnd < 0) {
1735 middle = (begin + end) / 2.;
1739 if (fdEnd * fdMiddle < 0) {
1744 }
else if (fdBegin * fdMiddle < 0) {
1750 cgi->Com_Error(
ERR_DROP,
"AIR_GetDestinationFindRoot: Error in calculation, can't find root");
1752 middle = (begin + end) / 2.;
1756 epsilon = end - middle ;
1758 if (epsilon < PRECISION_ROOT) {
1763 }
while (fBegin * fEnd > 0);
1766 cgi->Com_DPrintf(
DEBUG_CLIENT,
"AIR_GetDestinationFindRoot: Did not find solution is range %.2f, %.2f\n", start, MAXIMUM_VALUE_ROOT);
1773 middle = (begin + end) / 2.;
1777 if (fEnd * fMiddle < 0) {
1781 }
else if (fBegin * fMiddle < 0) {
1786 cgi->Com_DPrintf(
DEBUG_CLIENT,
"AIR_GetDestinationFindRoot: Error in calculation, one of the value is nan\n");
1789 middle = (begin + end) / 2.;
1792 epsilon = end - middle ;
1793 }
while (epsilon > PRECISION_ROOT);
1808 vec3_t shooterPos, targetPos, targetDestPos, shooterDestPos, rotationAxis;
1809 vec3_t tangentVectTS, tangentVectTD;
1848 B = acos(
DotProduct(tangentVectTS, tangentVectTD));
1869 if (fabs(b - speedRatio * a) < .1)
1872 cgi->Com_DPrintf(
DEBUG_CLIENT,
"AIR_GetDestinationWhilePursuing: reject solution: doesn't fit %.2f == %.2f\n", b, speedRatio * a);
1883 assert(
dest[0] <= 180.0f &&
dest[0] >= -180.0f &&
dest[1] <= 90.0f &&
dest[1] >= -90.0f);
1909 cgi->Com_DPrintf(
DEBUG_CLIENT,
"AIR_SendAircraftPursuingUFO: not enough fuel to anticipate target movement: go directly to target position\n");
1921 aircraft->
point = 0;
1954 cgi->LIST_AddPointer(&aircraft->
acTeam, employee);
1971 return cgi->LIST_GetPointer(aircraft->
acTeam, employee) !=
nullptr;
1982 return cgi->LIST_Count(aircraft->
acTeam);
1995 if (aircraft->
pilot ==
nullptr || pilot ==
nullptr) {
1996 aircraft->
pilot = pilot;
2025 if (aircraft ==
nullptr)
2028 if (aircraft->
pilot ==
nullptr)
2032 float baseProbability = (float) pilotSkill;
2036 baseProbability *=
cgi->csi->terrainDefs.getSurvivalChance(color);
2039 float randomProbability =
crand() * (float) pilotSkill;
2040 if (randomProbability > 0.25f * baseProbability) {
2041 while (randomProbability > 0.25f * baseProbability)
2042 randomProbability /= 2.0f;
2045 const float survivalProbability = baseProbability + randomProbability;
2046 return survivalProbability >= (float) pilotSkill;
2089 int numAllWeaponRanges = 0;
2090 int numUniqueWeaponRanges = 0;
2095 for (idxSlot = 0; idxSlot < maxSlot; idxSlot++) {
2103 numAllWeaponRanges++;
2106 if (numAllWeaponRanges > 0) {
2108 qsort(allWeaponRanges, numAllWeaponRanges,
sizeof(allWeaponRanges[0]),
Q_FloatSort);
2111 for (idxAllWeap = 0; idxAllWeap < numAllWeaponRanges; idxAllWeap++) {
2112 if (allWeaponRanges[idxAllWeap] != weaponRanges[numUniqueWeaponRanges - 1] || idxAllWeap == 0) {
2113 weaponRanges[numUniqueWeaponRanges] = allWeaponRanges[idxAllWeap];
2114 numUniqueWeaponRanges++;
2119 return numUniqueWeaponRanges;
2131 for (
int j = 0; j < route->
numPoints; j++) {
2148 for (
int i = 0;
i < num;
i++) {
2194 cgi->Com_Printf(
"Error: UFO '%s'is not linked to any mission\n", aircraft->
id);
2222 cgi->Com_Printf(
"Warning: ufo '%s' stats %i: %i is smaller than 0\n", aircraft->
id,
i, aircraft->
stats[
i]);
2224 if (aircraft->
stats[
i] != 0) {
2287 if (!ufo || (ufo->
id ==
nullptr))
2319 cgi->Com_Printf(
"Error: Trying to assign more than max (%d) Aircraft Slots (cur is %d)\n", max,
i);
2342 cgi->Com_Printf(
"AIR_Load: number of points (%i) for UFO route exceed maximum value (%i)\n",
count,
LINE_MAXPTS);
2359 const char* statusId;
2367 *craft = *crafttype;
2373 if (craft->
idx < 0) {
2374 cgi->Com_Printf(
"Invalid (or no) aircraft index %i\n", craft->
idx);
2382 cgi->Com_Printf(
"Invalid aircraft status '%s'\n", statusId);
2424 cgi->Com_Printf(
"Invalid aircraft stat '%s'\n", statId);
2432 cgi->Com_Printf(
"Warning: ufo '%s' stats %i: %i is smaller than 0\n", craft->
id, idx, craft->
stats[idx]);
2480 craft->
radar.ufoDetectionProbability = crafttype->
radar.ufoDetectionProbability;
2487 cgi->Com_Error(
ERR_DROP,
"AIR_LoadAircraftXML: Cannot create ItemCargo object\n");
2496 cgi->Com_Error(
ERR_DROP,
"AIR_LoadAircraftXML: Cannot create AlienCargo object\n");
2561 for (
i =
ccs.numUFOs - 1;
i >= 0;
i--) {
2564 cgi->Com_Printf(
"AIR_Load: Found invalid ufo entry - remove it - time: %i - speed: %i\n",
2578 bool success =
true;
2591 if (!aircraft->mission) {
2592 cgi->Com_Printf(
"Aircraft %s (idx: %i) is linked to an invalid mission: %s\n", aircraft->name, aircraft->idx, aircraft->missionID);
2596 cgi->Free(aircraft->missionID);
2597 aircraft->missionID =
nullptr;
2608 cgi->Com_Printf(
"Warning: %s (idx: %i) has no mission assigned, removing it\n", ufo->
name, ufo->
idx);
2614 cgi->Com_Printf(
"Warning: %s (idx: %i) is linked to an invalid mission %s, removing it\n", ufo->
name, ufo->
idx, ufo->
missionID);
2673 int i, j, k, error = 0;
2676 for (
i = 0, a =
ccs.aircraftTemplates;
i <
ccs.numAircraftTemplates;
i++, a++) {
2677 if (a->
name[0] ==
'\0') {
2679 cgi->Com_Printf(
"...... aircraft '%s' has no name\n", a->
id);
2683 cgi->Com_Printf(
"...... aircraft '%s' has no defaultName\n", a->
id);
2690 cgi->Com_Printf(
"...... aircraft '%s' has an item (%s) too heavy for its slot\n", a->
id, a->
weapons[j].
item->
id);
2700 cgi->Com_Printf(
"...... aircraft '%s' has 2 weapons slots at the same location\n", a->
id);
2708 cgi->Com_Printf(
"...... aircraft '%s' has 2 electronics slots at the same location\n", a->
id);
2742 cgi->Com_DPrintf(
DEBUG_CLIENT,
"AIR_RemoveEmployee: base: %i - aircraft->idx: %i\n",
2748 cgi->Com_Printf(
"Warning: pilot of aircraft %i is not a qualified pilot (ucn: %i)\n", aircraft->
idx, employee->
chr.
ucn);
2753 return cgi->LIST_Remove(&aircraft->
acTeam, employee);
2808 cgi->Com_Error(
ERR_DROP,
"AIR_RemoveEmployees: Error, there went something wrong with soldier-removing from aircraft.");
2820 cgi->Com_DPrintf(
DEBUG_CLIENT,
"AIR_MoveEmployeeInventoryIntoStorage: No team to remove equipment from.\n");
2826 while ((cont = employee->chr.inv.getNextCont(cont,
true))) {
2829 const Item item = *ic;
2855 if (!employee || !aircraft)
2879 cgi->Com_Printf(
"AIR_AssignInitial: No aircraft given\n");
2890 if (employee->baseHired != base)
2899 {
"debug_listaircraftsample", AIR_ListAircraftSamples_f,
"Show aircraft parameter on game console"},
2900 {
"debug_listaircraft", AIR_ListAircraft_f,
"Debug function to list all aircraft in all bases"},
2901 {
"debug_listaircraftidx", AIR_ListCraftIndexes_f,
"Debug function to list local/global aircraft indexes"},
2903 {
nullptr,
nullptr,
nullptr}
2922 if (craft->alienCargo !=
nullptr) {
2923 delete craft->alienCargo;
2924 craft->alienCargo =
nullptr;
2926 if (craft->itemCargo !=
nullptr) {
2927 delete craft->itemCargo;
2928 craft->itemCargo =
nullptr;
2931 cgi->LIST_Delete(&
ccs.aircraft);
DateTime class definition.
Alien cargo class header.
CGAME_HARD_LINKED_FUNCTIONS linkedList_t * LIST_Add(linkedList_t **listDest, void const *data, size_t length)
Share stuff between the different cgame implementations.
bool load(xmlNode_t *root)
Load alien cargo from xml savegame.
bool save(xmlNode_t *root) const
Save alien cargo to xml savegame.
Item * getNextItem(const Item *prev) const
Class describing a point of time.
int getTimeAsSeconds() const
Return the time part of the DateTime as seconds.
static const short SECONDS_PER_HOUR
int getDateAsDays() const
Return the date part of the DateTime as days.
employeeType_t getType() const
inventory definition with all its containers
const Container * getNextCont(const Container *prev, bool inclTemp=false) const
void empty(void)
Empties the cargo.
bool load(xmlNode_t *root)
Load item cargo from xml savegame.
bool save(xmlNode_t *root) const
Save item cargo to xml savegame.
linkedList_t * list(void) const
Returns a copy of the cargo list.
virtual bool add(const objDef_t *od, int amount, int looseAmount)
Add items to the cargo.
item instance data, with linked list capability
const objDef_t * ammoDef(void) const
const objDef_t * def(void) const
void AIR_AssignInitial(aircraft_t *aircraft)
Assigns initial team of soldiers to aircraft.
void AIR_AircraftReturnToBase(aircraft_t *aircraft)
Calculates the way back to homebase for given aircraft and returns it.
bool AIR_CanIntercept(const aircraft_t *aircraft)
void AIR_RemovePilotFromAssignedAircraft(const base_t *base, const Employee *pilot)
Checks to see if the pilot is in any aircraft at this base. If he is then he is removed from that air...
Employee * AIR_GetPilot(const aircraft_t *aircraft)
Get pilot of an aircraft.
void AIR_DeleteAircraft(aircraft_t *aircraft)
Removes an aircraft from its base and the game.
static void AIR_SaveAircraftSlotsXML(const aircraftSlot_t *slot, const int num, xmlNode_t *p, bool weapon)
Saves an item slot.
const char * AIR_AircraftStatusToName(const aircraft_t *aircraft)
Translates the aircraft status id to a translatable string.
void AIR_CampaignRun(const campaign_t *campaign, int dt, bool updateRadarOverlay)
Handles aircraft movement and actions in geoscape mode.
void AIR_ParseAircraft(const char *name, const char **text, bool assignAircraftItems)
Parses all aircraft that are defined in our UFO-scripts.
bool AIR_AircraftHasEnoughFuel(const aircraft_t *aircraft, const vec2_t destination)
check if aircraft has enough fuel to go to destination, and then come back home
bool AIR_SendAircraftToMission(aircraft_t *aircraft, mission_t *mission)
Sends the specified aircraft to specified mission.
static void AII_CarriedItems(const Inventory *soldierInventory)
Process items carried by soldiers.
static void AII_SetAircraftInSlots(aircraft_t *aircraft)
Initialise aircraft pointer in each slot of an aircraft.
int AIR_BaseCountAircraft(const base_t *base)
Returns the number of aircraft on the given base.
static const cmdList_t aircraftDebugCmds[]
void AII_CollectingItems(aircraft_t *aircraft, int won)
Collect items from the battlefield.
int AIR_GetOperationRange(const aircraft_t *aircraft)
Calculates the range an aircraft can fly on the geoscape.
int AIR_CountInBaseByTemplate(const base_t *base, const aircraft_t *aircraftTemplate)
Calculates the amount of aircraft (of the given type) in the selected base.
static void AIR_CorrectAircraftSlotPointers(aircraft_t *aircraft)
resets aircraftSlots' backreference pointers for aircraft
void AIR_AircraftsNotifyUFORemoved(const aircraft_t *const ufo, bool destroyed)
Notify that a UFO has been removed.
aircraft_t * AIR_NewAircraft(base_t *base, const aircraft_t *aircraftTemplate)
Places a new aircraft in the given base.
bool AIR_SetPilot(aircraft_t *aircraft, Employee *pilot)
Assign a pilot to an aircraft.
int AIR_GetAircraftWeaponRanges(const aircraftSlot_t *slot, int maxSlot, float *weaponRanges)
Get the all the unique weapon ranges of this aircraft.
int AIR_GetRemainingRange(const aircraft_t *aircraft)
Calculates the remaining range the aircraft can fly.
bool AIR_AddToAircraftTeam(aircraft_t *aircraft, Employee *employee)
Adds given employee to given aircraft.
bool AIR_AircraftHasEnoughFuelOneWay(const aircraft_t *aircraft, const vec2_t destination)
check if aircraft has enough fuel to go to destination
bool AIR_AircraftAllowed(const base_t *base)
Returns true if the current base is able to handle aircraft.
static void AIR_TransferItemsCarriedByCharacterToBase(character_t *chr, base_t *sourceBase, base_t *destBase)
Transfer items carried by a soldier from one base to another.
static bool AIR_SaveAircraftXML(xmlNode_t *p, const aircraft_t *const aircraft, bool const isUfo)
Saves an aircraft.
bool AIR_IsInAircraftTeam(const aircraft_t *aircraft, const Employee *employee)
Checks whether given employee is in given aircraft.
void AII_CollectItem(aircraft_t *aircraft, const objDef_t *item, int amount)
Add an item to aircraft inventory.
void AIR_AircraftsNotifyMissionRemoved(const mission_t *const mission)
Notify aircraft that a mission has been removed.
int AIR_AircraftMenuStatsValues(const int value, const int stat)
Some of the aircraft values needs special calculations when they are shown in the menus.
void AIR_MoveAircraftIntoNewHomebase(aircraft_t *aircraft, base_t *base)
Moves a given aircraft to a new base (also the employees and inventory).
bool AIR_PilotSurvivedCrash(const aircraft_t *aircraft)
Determine if an aircraft's pilot survived a crash, based on his piloting skill (and a bit of randomne...
static void AIR_LoadAircraftSlotsXML(aircraft_t *aircraft, aircraftSlot_t *slot, xmlNode_t *p, bool weapon, const int max)
Loads the weapon slots of an aircraft.
static float AIR_GetDestinationFunction(const float c, const float B, const float speedRatio, float a)
funtion we need to find roots.
bool AIR_IsAircraftOnGeoscape(const aircraft_t *aircraft)
Checks whether given aircraft is on geoscape.
bool AIR_SendAircraftPursuingUFO(aircraft_t *aircraft, aircraft_t *ufo)
Make the specified aircraft purchasing a UFO.
bool AIR_RemoveEmployee(Employee *employee, aircraft_t *aircraft)
Removes a soldier from an aircraft.
void AIR_ResetAircraftTeam(aircraft_t *aircraft)
Resets team in given aircraft.
static bool AIR_PostLoadInitMissions(void)
Set the mission pointers for all the aircraft after loading a savegame.
int AIR_GetTeamSize(const aircraft_t *aircraft)
Counts the number of soldiers in given aircraft.
static const value_t aircraft_param_vals[]
Valid aircraft parameter definitions from script files.
bool AIR_ScriptSanityCheck(void)
Checks the parsed aircraft for errors.
void AIR_AutoAddPilotToAircraft(const base_t *base, Employee *pilot)
Adds the pilot to the first available aircraft at the specified base.
void AIR_MoveEmployeeInventoryIntoStorage(const aircraft_t &aircraft, equipDef_t &ed)
Move all the equipment carried by the team on the aircraft into the given equipment.
static void AIR_Refuel(aircraft_t *aircraft, int deltaTime)
const char *const air_slot_type_strings[]
static float AIR_GetDestinationFindRoot(const float c, const float B, const float speedRatio, float start)
Find the roots of a function.
static bool AIR_LoadAircraftXML(xmlNode_t *p, aircraft_t *craft)
Loads an Aircraft from the savegame.
bool AIR_LoadXML(xmlNode_t *parent)
static void AIR_Move(aircraft_t *aircraft, int deltaTime)
static void AII_CollectItem_(void *data, const objDef_t *item, int amount)
bool AIR_SaveXML(xmlNode_t *parent)
Save callback for savegames in xml format.
bool AIR_AddEmployee(Employee *employee, aircraft_t *aircraft)
Assigns a soldier to an aircraft.
void AIR_AircraftsUFODisappear(const aircraft_t *const ufo)
Notify that a UFO disappear from radars.
static const value_t aircraft_vals[]
Valid aircraft definition values from script files.
const char * AIR_CheckMoveIntoNewHomebase(const aircraft_t *aircraft, const base_t *base)
Checks if destination base can store an aircraft and its team.
bool AIR_PostLoadInit(void)
Actions needs to be done after loading the savegame.
const aircraft_t * AIR_GetAircraft(const char *name)
Searches the global array of aircraft types for a given aircraft.
void AIR_GetDestinationWhilePursuing(const aircraft_t *shooter, const aircraft_t *target, vec2_t dest)
Calculates the point where aircraft should go to intecept a moving target.
bool AIR_BaseHasAircraft(const base_t *base)
Checks whether there is any aircraft assigned to the given base.
static int AIR_GetStorageRoom(const aircraft_t *aircraft)
Calculate used storage room corresponding to items in an aircraft.
static char const *const air_position_strings[]
List of valid strings for itemPos_t.
void AIR_DestroyAircraft(aircraft_t *aircraft, bool killPilot)
Removes an aircraft from its base and the game.
void AIR_InitStartup(void)
Init actions for aircraft-subsystem.
static const value_t aircraft_radar_vals[]
Valid radar definition values for an aircraft from script files.
static float AIR_GetDestinationDerivativeFunction(const float c, const float B, const float speedRatio, float a)
derivative of the funtion we need to find roots.
aircraft_t * AIR_GetAircraftFromBaseByIDXSafe(const base_t *base, int index)
static void AII_CollectAmmo(void *data, const Item *magazine)
Count and collect ammo from gun magazine.
static void AIR_SaveRouteXML(xmlNode_t *node, const mapline_t *route)
Saves an route plan of an aircraft.
bool AIR_IsAircraftInBase(const aircraft_t *aircraft)
Checks whether given aircraft is in its homebase.
const aircraft_t * AIR_GetAircraftSilent(const char *name)
Searches the global array of aircraft types for a given aircraft.
bool AIR_Delete(base_t *base, aircraft_t *aircraft)
Will remove the given aircraft from the base.
baseCapacities_t AIR_GetHangarCapacityType(const aircraft_t *aircraft)
Returns capacity type needed for an aircraft.
static void AII_InitialiseAircraftSlots(aircraft_t *aircraftTemplate)
Initialise all values of an aircraft slot.
aircraft_t * AIR_GetFirstFromBase(const base_t *b)
Iterates through the aircraft of a base.
static bool AIR_LoadRouteXML(xmlNode_t *p, mapline_t *route)
Loads the route of an aircraft.
const aircraft_t * AIR_IsEmployeeInAircraft(const Employee *employee, const aircraft_t *aircraft)
Tells you if an employee is assigned to an aircraft.
void AIR_Shutdown(void)
Closing actions for aircraft-subsystem.
bool AIR_AircraftMakeMove(int dt, aircraft_t *aircraft)
Moves given aircraft.
aircraft_t * AIR_AircraftGetFromIDX(int aircraftIdx)
Returns aircraft for a given global index.
void AIR_RemoveEmployees(aircraft_t &aircraft)
Removes all soldiers from an aircraft.
aircraft_t * AIR_Add(base_t *base, const aircraft_t *aircraftTemplate)
Adds a new aircraft from a given aircraft template to the base and sets the homebase for the new airc...
#define AIR_Foreach(var)
iterates trough all aircraft
#define AIRCRAFT_REFUEL_FACTOR
#define AIR_ForeachFromBase(var, base)
iterates trough all aircraft from a specific homebase
itemPos_t
different positions for aircraft items
#define AIR_IsUFO(aircraft)
void AIR_ShutdownCallbacks(void)
void AIR_InitCallbacks(void)
Header file for menu related console command callbacks.
void AIRFIGHT_ExecuteActions(const campaign_t *campaign, aircraft_t *shooter, aircraft_t *target)
Decide what an attacking aircraft can do.
bool AIRFIGHT_SaveXML(xmlNode_t *parent)
Save callback for savegames in XML Format.
bool AIRFIGHT_LoadXML(xmlNode_t *parent)
Load callback for savegames in XML Format.
baseCapacities_t B_GetCapacityFromBuildingType(buildingType_t type)
Get the capacity associated to a building type.
base_t * B_GetFoundedBaseByIDX(int baseIdx)
Array bound check for the base index.
base_t * B_GetNext(base_t *lastBase)
Iterates through founded bases.
void B_AircraftReturnedToHomeBase(aircraft_t *aircraft)
Do anything when dropship returns to base.
int B_AddAntimatter(base_t *base, int amount)
Manages antimatter (adding, removing) through Antimatter Storage Facility.
base_t * B_GetBaseByIDX(int baseIdx)
Array bound check for the base index. Will also return unfounded bases as long as the index is in the...
buildingType_t B_GetBuildingTypeByCapacity(baseCapacities_t cap)
Get building type by base capacity.
int B_ItemInBase(const objDef_t *item, const base_t *base)
Check if the item has been collected (i.e it is in the storage) in the given base.
int B_AddToStorage(base_t *base, const objDef_t *obj, int amount)
Add/remove items to/from the storage.
bool B_GetBuildingStatus(const base_t *const base, const buildingType_t buildingType)
Get the status associated to a building.
#define B_IsUnderAttack(base)
building_t * B_GetBuildingTemplateSilent(const char *buildingName)
Returns the building in the global building-types list that has the unique name buildingID.
Header for base building related stuff.
memPool_t * cp_campaignPool
Header file for single player campaign control.
const cgame_import_t * cgi
void CAP_AddCurrent(base_t *base, baseCapacities_t capacity, int value)
Changes the current (used) capacity on a base.
int CAP_GetFreeCapacity(const base_t *base, baseCapacities_t capacityType)
Returns the free capacity of a type.
baseCapacities_t
All possible capacities in base.
bool E_DeleteEmployee(Employee *employee)
Removes the employee completely from the game (buildings + global list).
Employee * E_GetEmployeeFromChrUCN(int uniqueCharacterNumber)
Searches all employee for the ucn (character id).
bool E_MoveIntoNewBase(Employee *employee, base_t *newBase)
Employee * E_GetEmployeeByTypeFromChrUCN(employeeType_t type, int uniqueCharacterNumber)
Searches employee from a type for the ucn (character id).
void E_RemoveInventoryFromStorage(Employee *employee)
Removes the items of an employee (soldier) from the base storage (s)he is hired at.
#define E_Foreach(employeeType, var)
mission_t * GEO_SelectMission(mission_t *mission)
Select the specified mission.
const byte * GEO_GetColor(const vec2_t pos, mapType_t type, bool *coast)
Returns the color value from geoscape of a certain mask (terrain, culture or population) at a given p...
void GEO_NotifyAircraftRemoved(const aircraft_t *aircraft)
Notify that an aircraft has been removed from game.
void GEO_SelectAircraft(aircraft_t *aircraft)
Select the specified aircraft on the geoscape.
bool GEO_IsRadarOverlayActivated(void)
void GEO_CalcLine(const vec2_t start, const vec2_t end, mapline_t *line)
Calculate the shortest way to go from start to end on a sphere.
void GEO_CheckPositionBoundaries(float *pos)
Check that a position (in latitude / longitude) is within boundaries.
Header for Geoscape management.
#define GEO_SetInterceptorAircraft(interceptor)
#define KILOMETER_PER_DEGREE
#define GEO_SetMissionAircraft(aircraft)
bool AII_ReloadWeapon(aircraftSlot_t *slot)
Reloads an aircraft/defence-system weapon.
void AII_LoadOneSlotXML(xmlNode_t *node, aircraftSlot_t *slot, bool weapon)
Loads one slot (base, installation or aircraft).
itemWeight_t AII_GetItemWeightBySize(const objDef_t *od)
Returns craftitem weight based on size.
void AII_RemoveItemFromSlot(base_t *base, aircraftSlot_t *slot, bool ammo)
Remove the item from the slot (or optionally its ammo only) and put it the base storage.
void AII_ReloadAircraftWeapons(aircraft_t *aircraft)
Reload the weapons of an aircraft.
void AII_UpdateAircraftStats(aircraft_t *aircraft)
Update the value of stats array of an aircraft.
void AII_InitialiseSlot(aircraftSlot_t *slot, aircraft_t *aircraftTemplate, base_t *base, installation_t *installation, aircraftItemType_t type)
Initialise values of one slot of an aircraft or basedefence common to all types of items.
void AII_SaveOneSlotXML(xmlNode_t *p, const aircraftSlot_t *slot, bool weapon)
Save callback for savegames in XML Format.
Header for slot management related stuff.
uiMessageListNodeMessage_t * MSO_CheckAddNewMessage(const notify_t messagecategory, const char *title, const char *text, messageType_t type, technology_t *pedia, bool popup)
Adds a new message to message stack. It uses message settings to verify whether sound should be playe...
@ NT_AIRCRAFT_CANNOTREFUEL
@ NT_AIRCRAFT_ARRIVEDHOME
uiMessageListNodeMessage_t * MS_AddNewMessage(const char *title, const char *text, messageType_t type, technology_t *pedia, bool popup, bool playSound)
Adds a new message to message stack.
char cp_messageBuffer[MAX_MESSAGE_TEXT]
mission_t * CP_GetMissionByID(const char *missionId)
Get a mission in ccs.missions by Id.
const char * MIS_GetName(const mission_t *mission)
Returns a short translated name for a mission.
Campaign missions headers.
void RADAR_Initialise(radar_t *radar, float range, float trackingRange, float level, bool updateSourceRadarMap)
Set radar range to new value.
void RADAR_UpdateWholeRadarOverlay(void)
Update radar overlay of base, installation and aircraft range.
void RADAR_InitialiseUFOs(radar_t *radar)
Reset UFO sensored on radar.
#define MAX_UFOONGEOSCAPE
void RS_MarkCollected(technology_t *tech)
Marks a give technology as collected.
technology_t * RS_GetTechForItem(const objDef_t *item)
Returns technology entry for an item.
technology_t * RS_GetTechByID(const char *id)
return a pointer to the technology identified by given id string
#define ANTIMATTER_ITEM_ID
void CP_GameTimeStop(void)
Stop game time speed.
Campaign geoscape time header.
void TR_NotifyAircraftRemoved(const aircraft_t *aircraft)
Notify that an aircraft has been removed.
aircraft_t * UFO_GetByIDX(const int idx)
returns the UFO on the geoscape with a certain index
aircraft_t * UFO_GetNext(aircraft_t *lastUFO)
Iterates through the UFOs.
void UFO_RemoveFromGeoscape(aircraft_t *ufo)
Remove the specified ufo from geoscape.
#define UFO_GetGeoscapeIDX(ufo)
void Sys_Error(const char *error,...)
const objDef_t * INVSH_GetItemByID(const char *id)
Returns the item that belongs to the given id or nullptr if it wasn't found.
aircraftItemType_t
All different types of craft items.
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
#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 ...
vec_t VectorNormalize(vec3_t v)
Calculate unit vector for a given vec3_t.
float crand(void)
Return random values between -1 and 1.
void RotatePointAroundVector(vec3_t dst, const vec3_t dir, const vec3_t point, float degrees)
Rotate a point around a given vector.
void PolarToVec(const vec2_t a, vec3_t v)
Converts longitude and latitude to a 3D vector in Euclidean coordinates.
double GetDistanceOnGlobe(const vec2_t pos1, const vec2_t pos2)
Calculate distance on the geoscape.
void VecToPolar(const vec3_t v, vec2_t a)
Converts vector coordinates into polar coordinates.
void CrossProduct(const vec3_t v1, const vec3_t v2, vec3_t cross)
binary operation on vectors in a three-dimensional space
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.
Shared parsing functions.
QGL_EXTERN GLenum GLuint * dest
QGL_EXTERN GLsizei const GLvoid * data
QGL_EXTERN GLint GLenum type
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
XML tag constants for savegame.
#define SAVE_AIRCRAFT_DAMAGE
#define SAVE_AIRCRAFT_HOMEBASE
#define SAVE_AIRCRAFT_VAL
#define SAVE_AIRCRAFT_UFOS
#define SAVE_AIRCRAFT_PILOTUCN
#define SAVE_AIRCRAFT_AIRCRAFTTEAM
#define SAVE_AIRCRAFTSTATUS_NAMESPACE
#define SAVE_AIRCRAFT_ROUTE
#define SAVE_AIRCRAFT_ROUTE_DISTANCE
#define SAVE_AIRCRAFT_ALIENCARGO
#define SAVE_AIRCRAFT_FUEL
#define SAVE_AIRCRAFT_ELECTRONICS
#define SAVE_AIRCRAFT_PHALANX
#define SAVE_AIRCRAFT_AIRCRAFT
#define SAVE_AIRCRAFT_DETECTIONIDX
#define SAVE_AIRCRAFT_POS
#define SAVE_AIRCRAFT_LANDED
#define SAVE_AIRCRAFT_POINT
#define SAVE_AIRCRAFT_AIRSTATID
#define SAVE_AIRCRAFT_SHIELDS
#define SAVE_AIRCRAFT_DETECTED
#define SAVE_AIRCRAFT_MEMBER
#define SAVE_AIRCRAFT_TEAM_UCN
static const constListEntry_t saveAircraftConstants[]
#define SAVE_AIRCRAFT_ROUTE_POINT
#define SAVE_AIRCRAFT_WEAPONS
#define SAVE_AIRCRAFT_CARGO
#define SAVE_AIRCRAFT_AIRCRAFTTARGET
#define SAVE_AIRCRAFT_MISSIONID
#define SAVE_AIRCRAFT_AIRSTATS
#define SAVE_AIRCRAFT_NAME
#define SAVE_AIRCRAFT_AIRSTAT
#define SAVE_AIRCRAFT_LASTSPOTTED_DATE
#define SAVE_AIRCRAFT_SLOT
#define SAVE_AIRCRAFT_TIME
#define SAVE_AIRCRAFT_PROJECTILES
#define SAVE_AIRCRAFT_IDX
#define SAVE_AIRCRAFT_DIRECTION
#define SAVE_AIRCRAFT_STATUS
#define SAVE_AIRCRAFTSTAT_NAMESPACE
#define MEMBER_SIZEOF(TYPE, MEMBER)
#define AIR_SLOT_TYPE_STRINGS
bool Q_strnull(const char *string)
void Q_strncpyz(char *dest, const char *src, size_t destsize)
Safe strncpy that ensures a trailing zero.
bool Com_sprintf(char *dest, size_t size, const char *fmt,...)
copies formatted string with buffer-size checking
int Q_FloatSort(const void *float1, const void *float2)
Compare two floats.
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...
An aircraft with all it's data.
aircraftSlot_t weapons[MAX_AIRCRAFTSLOT]
struct aircraft_s * aircraftTarget
class AlienCargo * alienCargo
struct mission_s * mission
class DateTime lastSpotted
class ItemCargo * itemCargo
void setUfoType(ufoType_t ufoT)
aircraftSlot_t electronics[MAX_AIRCRAFTSLOT]
bool notifySent[MAX_AIR_NOTIFICATIONS]
struct installation_s * installation
struct aircraft_s * aircraft
A base with all it's data.
aircraft_t * aircraftCurrent
baseWeapon_t batteries[MAX_BASE_SLOT]
baseWeapon_t lasers[MAX_BASE_SLOT]
A building with all it's data.
buildingType_t buildingType
Describes a character with all its attributes.
int skills[SKILL_NUM_TYPES]
float stats[AIR_STATS_MAX]
int numItems[MAX_OBJDEFS]
void addClip(const Item *item)
Combine the rounds of partially used clips.
A path on the map described by 2D points.
vec2_t point[LINE_MAXPTS]
Defines all attributes of objects used in the inventory.
bool isReloadable() const
This is the technology parsed from research.ufo.
#define DotProduct(x, y)
Returns the distance between two 3-dimensional vectors.
#define VectorSet(v, x, y, z)
#define Vector2Copy(src, dest)
xmlNode_t * XML_GetNextNode(xmlNode_t *current, xmlNode_t *parent, const char *name)
Get next Node of the XML tree by name.