aboutsummaryrefslogtreecommitdiff
path: root/engines/dm/champion.cpp
diff options
context:
space:
mode:
authorBendegúz Nagy2016-07-04 20:54:17 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commit411ad40ca43b900e3bdb9804ca39b10b25d6fa4b (patch)
treea02018074d8a8d70ac7f4589a068d13e502fe7ad /engines/dm/champion.cpp
parent7fef7b83127f532781fec64eea3229d56c080902 (diff)
downloadscummvm-rg350-411ad40ca43b900e3bdb9804ca39b10b25d6fa4b.tar.gz
scummvm-rg350-411ad40ca43b900e3bdb9804ca39b10b25d6fa4b.tar.bz2
scummvm-rg350-411ad40ca43b900e3bdb9804ca39b10b25d6fa4b.zip
DM: Add missing code to several display functions
Diffstat (limited to 'engines/dm/champion.cpp')
-rw-r--r--engines/dm/champion.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index 333243c969..b35e0d8f5a 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -427,6 +427,28 @@ void ChampionMan::f301_addObjectInSlot(ChampionIndex champIndex, Thing thing, Ch
champ->setAttributeFlag(k0x4000_ChampionAttributeViewport, true);
}
+int16 ChampionMan::f315_getScentOrdinal(int16 mapX, int16 mapY) {
+ uint16 searchedScentRedEagle;
+ int16 scentIndex;
+ Scent* scent;
+ Scent searchedScent;
+
+
+ if (scentIndex = _g407_party._scentCount) {
+ searchedScent.setMapX(mapX);
+ searchedScent.setMapY(mapY);
+ searchedScent.setMapIndex(_vm->_dungeonMan->_g272_currMapIndex);
+ searchedScentRedEagle = searchedScent.toUint16();
+ scent = &_g407_party._scents[scentIndex--];
+ do {
+ if ((*(--scent)).toUint16() == searchedScentRedEagle) {
+ return _vm->M0_indexToOrdinal(scentIndex);
+ }
+ } while (scentIndex--);
+ }
+ return 0;
+}
+
ChampionIndex ChampionMan::f285_getIndexInCell(ViewCell cell) {
for (uint16 i = 0; i < _g305_partyChampionCount; ++i) {
if ((_gK71_champions[i]._cell == cell) && _gK71_champions[i]._currHealth)