mirror of
https://github.com/whoahq/whoa.git
synced 2026-11-12 17:25:04 +03:00
feat(object): add Player_C_GetDisplayId
This commit is contained in:
2 files changed
+32
No files matched your search
@@ -0,0 +1,24 @@
|
||||
#include "object/client/Player_C.hpp"
|
||||
#include "db/Db.hpp"
|
||||
#include "object/Types.hpp"
|
||||
#include <storm/Error.hpp>
|
||||
|
||||
uint32_t Player_C_GetDisplayId(uint32_t race, uint32_t sex) {
|
||||
STORM_ASSERT(sex < UNITSEX_LAST);
|
||||
|
||||
auto raceRec = g_chrRacesDB.GetRecord(race);
|
||||
|
||||
if (!raceRec) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (sex == UNITSEX_MALE) {
|
||||
return raceRec->m_maleDisplayID;
|
||||
}
|
||||
|
||||
if (sex == UNITSEX_FEMALE) {
|
||||
return raceRec->m_femaleDisplayID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef OBJECT_CLIENT_PLAYER_C_HPP
|
||||
#define OBJECT_CLIENT_PLAYER_C_HPP
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
uint32_t Player_C_GetDisplayId(uint32_t race, uint32_t sex);
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user