mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-10 04:43:26 +00:00
DM: Add getIndexInCell function in ChampionMan
This commit is contained in:
parent
3ff3512c64
commit
332a515d2c
@ -5,7 +5,12 @@ namespace DM {
|
||||
|
||||
ChampionMan::ChampionMan(DMEngine *vm): _vm(vm) {}
|
||||
|
||||
ChampionIndex ChampionMan::getIndexInCell(int16 mapX, int16 mapY, ViewCell cell) {
|
||||
ChampionIndex ChampionMan::getIndexInCell(ViewCell cell) {
|
||||
for (uint16 i = 0; i < _partyChampionCount; ++i) {
|
||||
if ((_champions[i]._cell == cell) && _champions[i]._currHealth)
|
||||
return (ChampionIndex)i;
|
||||
}
|
||||
|
||||
return kChampionNone;
|
||||
}
|
||||
|
||||
|
@ -243,14 +243,14 @@ public:
|
||||
|
||||
class ChampionMan {
|
||||
DMEngine *_vm;
|
||||
Champion champions[4];
|
||||
Champion _champions[4];
|
||||
public:
|
||||
uint16 _partChampionCount;
|
||||
uint16 _partyChampionCount;
|
||||
bool _partyDead; // @ G0303_B_PartyDead
|
||||
Thing _leaderHand;
|
||||
|
||||
ChampionMan(DMEngine *vm);
|
||||
ChampionIndex getIndexInCell(int16 mapX, int16 mapY, ViewCell cell); // @ F0285_CHAMPION_GetIndexInCell
|
||||
ChampionIndex getIndexInCell(ViewCell cell); // @ F0285_CHAMPION_GetIndexInCell
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ LoadgameResponse LoadsaveMan::loadgame() {
|
||||
|
||||
if (newGame) {
|
||||
_vm->_restartGameAllowed = false;
|
||||
cm._partChampionCount = 0;
|
||||
cm._partyChampionCount = 0;
|
||||
cm._leaderHand = Thing::thingNone;
|
||||
_vm->_gameId = _vm->_rnd->getRandomNumber(65536) * _vm->_rnd->getRandomNumber(65536);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user