[General] Change type of Object::enchantmentCharge

sol2-server-rewrite
Koncord 6 years ago
parent 4cfb04aa7f
commit 0e97b769f9

@ -147,12 +147,12 @@ void Object::setCharge(int charge)
}
double Object::getEnchantmentCharge() const
float Object::getEnchantmentCharge() const
{
return object.enchantmentCharge;
}
void Object::setEnchantmentCharge(double enchantmentCharge)
void Object::setEnchantmentCharge(float enchantmentCharge)
{
changedObjectPlace = true;
object.enchantmentCharge = enchantmentCharge;
@ -251,7 +251,7 @@ tuple<string, int, int, double> Container::getItem(int i) const
return make_tuple(item.refId, item.count, item.charge, item.enchantmentCharge);
}
void Container::setItem(int i, const string &refId, int count, int charge, double enchantmentCharge)
void Container::setItem(int i, const string &refId, int count, int charge, float enchantmentCharge)
{
auto &item = object.containerItems.at(i);
item.refId = refId;
@ -261,7 +261,7 @@ void Container::setItem(int i, const string &refId, int count, int charge, doubl
changed = true;
}
void Container::addItem(const string &refId, int count, int charge, double enchantmentCharge)
void Container::addItem(const string &refId, int count, int charge, float enchantmentCharge)
{
mwmp::ContainerItem item;
item.refId = refId;

@ -66,8 +66,8 @@ public:
int getCharge() const;
void setCharge(int charge);
double getEnchantmentCharge() const;
void setEnchantmentCharge(double enchantmentCharge);
float getEnchantmentCharge() const;
void setEnchantmentCharge(float enchantmentCharge);
int getGoldValue() const;
void setGoldValue(int gold);
@ -99,9 +99,9 @@ public:
Container();
std::tuple<std::string, int, int, double> getItem(int i) const;
void addItem(const std::string &refId, int count, int charge, double enchantmentCharge);
void addItem(const std::string &refId, int count, int charge, float enchantmentCharge);
void setItem(int i, const std::string &refId, int count, int charge, double enchantmentCharge);
void setItem(int i, const std::string &refId, int count, int charge, float enchantmentCharge);
int getActionCount(int i) const;
size_t size() const;

@ -173,7 +173,7 @@ void WorldEvent::placeObjects(MWWorld::CellStore* cellStore)
if (worldObject.charge > -1)
newPtr.getCellRef().setCharge(worldObject.charge);
if (worldObject.enchantmentCharge > -1)
if (worldObject.enchantmentCharge > -1.0f)
newPtr.getCellRef().setEnchantmentCharge(worldObject.enchantmentCharge);
newPtr.getCellRef().setGoldValue(worldObject.goldValue);

@ -29,7 +29,7 @@ namespace mwmp
unsigned mpNum;
int count;
int charge;
double enchantmentCharge;
float enchantmentCharge;
int goldValue;
ESM::Position position;

Loading…
Cancel
Save