Skip to content

Commit

Permalink
More isPeasant usage
Browse files Browse the repository at this point in the history
  • Loading branch information
captainurist committed Oct 8, 2023
1 parent 20f0e95 commit 45d653b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/Engine/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -997,10 +997,7 @@ void Engine::_461103_load_level_sub() {
//{
// v3 = pActors[i].pMonsterInfo.uID;
v17 = 0;
if (pActors[i].monsterInfo.uID >= MONSTER_PEASANT_DWARF_FEMALE_A_A &&
pActors[i].monsterInfo.uID <= MONSTER_PEASANT_HUMAN2_FEMALE_C_C ||
pActors[i].monsterInfo.uID >= MONSTER_PEASANT_GOBLIN_FEMALE_A_A &&
pActors[i].monsterInfo.uID <= MONSTER_PEASANT_GOBLIN_MALE_C_C)
if (isPeasant(pActors[i].monsterInfo.uID))
v17 = 1;
// v1 = 0;
v4 = (std::to_underlying(pActors[i].monsterInfo.uID) - 1) % 3; // TODO(captainurist): encapsulate monster tier calculation.
Expand Down
4 changes: 4 additions & 0 deletions src/Engine/Objects/MonsterEnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ inline bool isPeasant(MonsterType monsterType) {
(monsterType >= MONSTER_TYPE_FIRST_PEASANT_GOBLIN && monsterType <= MONSTER_TYPE_LAST_PEASANT_GOBLIN);
}

inline bool isPeasant(MonsterId monsterId) {
return isPeasant(monsterTypeForMonsterId(monsterId));
}

CharacterSex sexForMonsterType(MonsterType monsterType);

Race raceForMonsterType(MonsterType monsterType);
Expand Down

0 comments on commit 45d653b

Please sign in to comment.