2025-03-29 23:43:21 +04:00
|
|
|
#include "clientobject/Unit_C.hpp"
|
|
|
|
|
|
2025-04-17 01:32:37 +04:00
|
|
|
#include "db/Db.hpp"
|
|
|
|
|
|
|
|
|
|
|
2025-03-29 23:43:21 +04:00
|
|
|
const char* CGUnit_C::GetDisplayRaceNameFromRecord(ChrRacesRec* record, uint8_t sexIn, uint8_t* sexOut) {
|
2025-04-17 01:32:37 +04:00
|
|
|
if (sexOut) {
|
|
|
|
|
*sexOut = sexIn;
|
|
|
|
|
}
|
|
|
|
|
if (!record) {
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
if (!sexIn) {
|
|
|
|
|
if (record->m_nameMale[0]) {
|
|
|
|
|
return record->m_nameMale;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (record->m_nameFemale[0]) {
|
|
|
|
|
if (sexOut) {
|
|
|
|
|
*sexOut = 1;
|
|
|
|
|
}
|
|
|
|
|
return record->m_nameFemale;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return record->m_name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sexIn != 1) {
|
|
|
|
|
return record->m_name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (record->m_nameFemale[0]) {
|
|
|
|
|
return record->m_nameFemale;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!record->m_nameMale[0]) {
|
|
|
|
|
return record->m_name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sexOut) {
|
|
|
|
|
*sexOut = 0;
|
|
|
|
|
}
|
|
|
|
|
return record->m_nameMale;
|
|
|
|
|
}
|
2025-03-29 23:43:21 +04:00
|
|
|
|
2025-04-17 01:32:37 +04:00
|
|
|
const char* CGUnit_C::GetDisplayClassNameFromRecord(ChrClassesRec* record, uint8_t sexIn, uint8_t* sexOut) {
|
2025-03-29 23:43:21 +04:00
|
|
|
if (sexOut) {
|
|
|
|
|
*sexOut = sexIn;
|
|
|
|
|
}
|
|
|
|
|
if (!record) {
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
if (!sexIn) {
|
|
|
|
|
if (record->m_nameMale[0]) {
|
|
|
|
|
return record->m_nameMale;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (record->m_nameFemale[0]) {
|
|
|
|
|
if (sexOut) {
|
|
|
|
|
*sexOut = 1;
|
|
|
|
|
}
|
|
|
|
|
return record->m_nameFemale;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return record->m_name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sexIn != 1) {
|
|
|
|
|
return record->m_name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (record->m_nameFemale[0]) {
|
|
|
|
|
return record->m_nameFemale;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!record->m_nameMale[0]) {
|
|
|
|
|
return record->m_name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sexOut) {
|
|
|
|
|
*sexOut = 0;
|
|
|
|
|
}
|
|
|
|
|
return record->m_nameMale;
|
|
|
|
|
}
|