diff options
author | Strangerke | 2016-07-23 09:34:11 +0200 |
---|---|---|
committer | Bendegúz Nagy | 2016-08-26 23:02:22 +0200 |
commit | 33aac99beeca9f101857aab326a4fc3e0647dc66 (patch) | |
tree | 358160552f9d1030337e31764dc89f7705661af9 /engines | |
parent | 877b1b051b746c44baec9f4b2114d9aedc1e07a9 (diff) | |
download | scummvm-rg350-33aac99beeca9f101857aab326a4fc3e0647dc66.tar.gz scummvm-rg350-33aac99beeca9f101857aab326a4fc3e0647dc66.tar.bz2 scummvm-rg350-33aac99beeca9f101857aab326a4fc3e0647dc66.zip |
DM: Reduce the scope of a couple of variables
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dm/champion.cpp | 6 | ||||
-rw-r--r-- | engines/dm/inventory.cpp | 22 |
2 files changed, 9 insertions, 19 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp index aac5584777..464aee72ee 100644 --- a/engines/dm/champion.cpp +++ b/engines/dm/champion.cpp @@ -1420,8 +1420,6 @@ void ChampionMan::f319_championKill(uint16 champIndex) { int16 L0963_i_AliveChampionIndex;
Thing L0964_T_Thing;
Champion* L0965_ps_Champion;
- Junk* L0966_ps_Junk;
-
L0965_ps_Champion = &_vm->_championMan->_gK71_champions[champIndex];
L0965_ps_Champion->_currHealth = 0;
@@ -1449,7 +1447,7 @@ void ChampionMan::f319_championKill(uint16 champIndex) { L0964_T_Thing = _vm->_dungeonMan->f166_getUnusedThing(k0x8000_championBones | k10_JunkThingType);
if (L0964_T_Thing == Thing::_none) {
} else {
- L0966_ps_Junk = (Junk*)_vm->_dungeonMan->f156_getThingData(L0964_T_Thing);
+ Junk* L0966_ps_Junk = (Junk*)_vm->_dungeonMan->f156_getThingData(L0964_T_Thing);
L0966_ps_Junk->setType(k5_JunkTypeBones);
L0966_ps_Junk->setDoNotDiscard(true);
L0966_ps_Junk->setChargeCount(champIndex);
@@ -1686,7 +1684,7 @@ void ChampionMan::f331_applyTimeEffects() { }
}
}
- if (!_vm->_championMan->_g300_partyIsSleeping && (L1010_ps_Champion->_dir != _vm->_dungeonMan->_g308_partyDir) && (_vm->_projexpl->_g361_lastCreatureAttackTime < (_vm->_g313_gameTime - 60))) {
+ if (!_vm->_championMan->_g300_partyIsSleeping && (L1010_ps_Champion->_dir != _vm->_dungeonMan->_g308_partyDir) && (_vm->_projexpl->_g361_lastCreatureAttackTime + 60 < (int32)_vm->_g313_gameTime)) {
L1010_ps_Champion->_dir = _vm->_dungeonMan->_g308_partyDir;
L1010_ps_Champion->_maximumDamageReceived = 0;
setFlag(L1010_ps_Champion->_attributes, k0x0400_ChampionAttributeIcon);
diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp index 1a15d44d30..c33524ab6f 100644 --- a/engines/dm/inventory.cpp +++ b/engines/dm/inventory.cpp @@ -566,7 +566,6 @@ void InventoryMan::f337_setDungeonViewPalette() { uint16 L1044_ui_Multiple; #define AL1044_T_Thing L1044_ui_Multiple #define AL1044_ui_TorchLightPower L1044_ui_Multiple - int16 L1045_ai_TorchesLightPower[8]; int16 g40_palIndexToLightAmmount[6] = {99, 75, 50, 25, 1, 0}; // @ G0040_ai_Graphic562_PaletteIndexToLightAmount @@ -576,6 +575,7 @@ void InventoryMan::f337_setDungeonViewPalette() { /* Get torch light power from both hands of each champion in the party */ int16 L1038_i_Counter = 4; /* BUG0_01 Coding error without consequence. The hands of four champions are inspected even if there are less champions in the party. No consequence as the data in unused champions is set to 0 and _vm->_objectMan->f32_getObjectType then returns -1 */ Champion *L1043_ps_Champion = _vm->_championMan->_gK71_champions; + int16 L1045_ai_TorchesLightPower[8]; AL1040_pi_TorchLightPower = L1045_ai_TorchesLightPower; while (L1038_i_Counter--) { AL1039_ui_SlotIndex = k1_ChampionSlotActionHand + 1; @@ -638,26 +638,18 @@ void InventoryMan::f337_setDungeonViewPalette() { } void InventoryMan::f338_decreaseTorchesLightPower() { - int16 L1046_i_ChampionCount; - int16 L1047_i_SlotIndex; - bool L1048_B_TorchChargeCountChanged; - int16 L1049_i_IconIndex; - Champion* L1050_ps_Champion; - Weapon* L1051_ps_Weapon; - - - L1048_B_TorchChargeCountChanged = false; - L1046_i_ChampionCount = _vm->_championMan->_g305_partyChampionCount; + bool L1048_B_TorchChargeCountChanged = false; + int16 L1046_i_ChampionCount = _vm->_championMan->_g305_partyChampionCount; if (_vm->_championMan->_g299_candidateChampionOrdinal) { L1046_i_ChampionCount--; } - L1050_ps_Champion = _vm->_championMan->_gK71_champions; + Champion *L1050_ps_Champion = _vm->_championMan->_gK71_champions; while (L1046_i_ChampionCount--) { - L1047_i_SlotIndex = k1_ChampionSlotActionHand + 1; + int16 L1047_i_SlotIndex = k1_ChampionSlotActionHand + 1; while (L1047_i_SlotIndex--) { - L1049_i_IconIndex = _vm->_objectMan->f33_getIconIndex(L1050_ps_Champion->_slots[L1047_i_SlotIndex]); + int16 L1049_i_IconIndex = _vm->_objectMan->f33_getIconIndex(L1050_ps_Champion->_slots[L1047_i_SlotIndex]); if ((L1049_i_IconIndex >= k4_IconIndiceWeaponTorchUnlit) && (L1049_i_IconIndex <= k7_IconIndiceWeaponTorchLit)) { - L1051_ps_Weapon = (Weapon*)_vm->_dungeonMan->f156_getThingData(L1050_ps_Champion->_slots[L1047_i_SlotIndex]); + Weapon *L1051_ps_Weapon = (Weapon *)_vm->_dungeonMan->f156_getThingData(L1050_ps_Champion->_slots[L1047_i_SlotIndex]); if (L1051_ps_Weapon->getChargeCount()) { if (L1051_ps_Weapon->setChargeCount(L1051_ps_Weapon->getChargeCount() - 1) == 0) { L1051_ps_Weapon->setDoNotDiscard(false); |