ULTIMA8: Use bool type for two firetype flags

This commit is contained in:
Matthew Duggan 2021-05-16 16:54:29 +09:00
parent 07dee61a72
commit f5d4a91576
2 changed files with 9 additions and 8 deletions

View File

@ -37,13 +37,14 @@ namespace Ultima {
namespace Ultima8 {
FireType::FireType(uint16 typeNo, uint16 minDamage, uint16 maxDamage, uint8 range,
uint8 numShots, uint16 shieldCost, uint8 shieldMask, uint8 accurate,
uint16 cellsPerRound, uint16 roundDuration, uint8 nearSprite) :
uint8 numShots, uint16 shieldCost, uint8 shieldMask, bool accurate,
uint16 cellsPerRound, uint16 roundDuration, bool nearSprite) :
_typeNo(typeNo), _minDamage(minDamage), _maxDamage(maxDamage),
_range(range), _numShots(numShots), _shieldCost(shieldCost),
_shieldMask(shieldMask), _accurate(accurate),
_cellsPerRound(cellsPerRound), _roundDuration(roundDuration),
_nearSprite(nearSprite) {
assert(maxDamage >= minDamage);
}
uint16 FireType::getRandomDamage() const {

View File

@ -35,8 +35,8 @@ struct Point3;
class FireType {
public:
FireType(uint16 typeNo, uint16 minDamage, uint16 maxDamage, uint8 range,
uint8 numShots, uint16 shieldCost, uint8 shieldMask, uint8 accurate,
uint16 cellsPerRound, uint16 roundDuration, uint8 nearSprite);
uint8 numShots, uint16 shieldCost, uint8 shieldMask, bool accurate,
uint16 cellsPerRound, uint16 roundDuration, bool nearSprite);
uint16 getTypeNo() const {
return _typeNo;
@ -66,7 +66,7 @@ public:
return _shieldMask;
}
uint8 getAccurate() const {
bool getAccurate() const {
return _accurate;
}
@ -78,7 +78,7 @@ public:
return _roundDuration;
}
uint8 getNearSprite() const {
bool getNearSprite() const {
return _nearSprite;
}
@ -97,10 +97,10 @@ private:
uint8 _numShots;
uint16 _shieldCost;
uint8 _shieldMask;
uint8 _accurate;
bool _accurate;
uint16 _cellsPerRound;
uint16 _roundDuration;
uint8 _nearSprite;
bool _nearSprite;
};
}