Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ namespace Map {
if (tribeID <= 0) {
return FALSE;
}
if (this->tribes[tribeID].predatorNearby > 0) {
// A scare tick counter (0..800), not a flag: the original tests it for non-zero (> 0 loses the match)
if (this->tribes[tribeID].predatorNearby != 0) {
return FALSE;
}
if (DAT_GameCore::instance.missionNumber1to20 == 38 && unitType == Map::Units::UT_CAMELSHBEAR) {
Expand All @@ -44,7 +45,7 @@ namespace Map {
int const _spawnX = DAT_UnitsState::instance.units[_unitID].x;
int const _spawnY = DAT_UnitsState::instance.units[_unitID].y;
int const _spawnHeight = DAT_UnitsState::instance.units[_unitID].terrainOrClimbHeight;
this->tribes[tribeID].field_0x288 = this->tribes[tribeID].field_0x288 + 1;
++this->tribes[tribeID].field_0x288;
if (this->tribes[tribeID].field_0x288 < spawnIntervalTicks) {
return FALSE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ namespace Map {
// FUNCTION: STRONGHOLDCRUSADER 0x00523590
void TribesState::updateAnimalHerdBehaviorState(int tribeID)
{
if (tribeID <= 0 || this->tribes[tribeID].predatorNearby > 0) {
// A scare tick counter (0..800), not a flag: the original tests it for non-zero (> 0 loses the match)
if (tribeID <= 0 || this->tribes[tribeID].predatorNearby != 0) {
return;
}
int unitSelectionIndex = 0;
while (unitSelectionIndex < this->tribes[tribeID].size) {
for (int unitSelectionIndex = 0; unitSelectionIndex < this->tribes[tribeID].size;) {
int const unitID = MACRO_CALL_MEMBER(Map::Units::TribesState_Func::getUnitIDForIndexInTribe, this)(
tribeID, unitSelectionIndex);
unitSelectionIndex = unitSelectionIndex + 1;
// Stepped here, right after the call (in the loop's header, the match is lost).
++unitSelectionIndex;
if (DAT_UnitsState::instance.units[unitID].logicalState == Map::Units::ULS_NORMAL
&& !DAT_UnitsState::instance.units[unitID].dying
&& DAT_UnitsState::instance.units[unitID].antelopeBasedRngValue == 2) {
Expand Down
Loading