MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / Sprite_Handle_Civilian_Movement

Method Sprite_Handle_Civilian_Movement

Source/Fodder.cpp:6699–6721  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6697}
6698
6699void cFodder::Sprite_Handle_Civilian_Movement(sSprite* pSprite) {
6700
6701 // Destination change cool down
6702 if (pSprite->field_4C) {
6703 pSprite->field_4C -= 1;
6704 if (pSprite->field_4C)
6705 return;
6706 }
6707
6708 if (pSprite->field_18 == eSprite_Hostage || pSprite->field_18 == eSprite_Enemy_Leader) {
6709 pSprite->field_26 = pSprite->field_0;
6710 pSprite->field_28 = pSprite->field_4;
6711 }
6712 else {
6713 if (Sprite_Handle_Civilian_RandomMovement(pSprite) < 0)
6714 return;
6715 }
6716
6717 // Random time until destination change
6718 int16 Data0 = tool_RandomGet() & 0x3F;
6719 Data0 += 0x14;
6720 pSprite->field_4C = static_cast<int8>(Data0);
6721}
6722
6723int16 cFodder::Sprite_Handle_Civilian_Within_Range_OpenCloseDoor(sSprite* pSprite) {
6724

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected