diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-04-10 00:58:39 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-04-10 13:36:59 +0200 |
commit | 045336a7a85322d7d07f372850802100dac75519 (patch) | |
tree | 1e5050d1786c65ecf0ba309aa9773499cf42081b /src/game-server | |
parent | 289c0874808d79c995a8bbbe12d19e7245b7fb81 (diff) | |
download | manaserv-045336a7a85322d7d07f372850802100dac75519.tar.gz manaserv-045336a7a85322d7d07f372850802100dac75519.tar.bz2 manaserv-045336a7a85322d7d07f372850802100dac75519.tar.xz manaserv-045336a7a85322d7d07f372850802100dac75519.zip |
Initialize attribute base and cached modified values
Attributes that didn't get a value yet are not communicated from account
to game server. This could leave some attributes with uninitialized
(random) values, like the amount of gold or some uncalculated attack
speed bonus.
Defaulting the value to 0 seems to be appropriate for all current cases.
When another default value should be used, it can be specified in
attributes.xml and will be sent from the account server.
Reviewed-by: Stefan Dombrowski
Diffstat (limited to 'src/game-server')
-rw-r--r-- | src/game-server/attribute.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/game-server/attribute.cpp b/src/game-server/attribute.cpp index 22c6e638..e37087d7 100644 --- a/src/game-server/attribute.cpp +++ b/src/game-server/attribute.cpp @@ -25,6 +25,7 @@ AttributeModifiersEffect::AttributeModifiersEffect(StackableType stackableType, ModifierEffectType effectType) : + mCacheVal(0), mMod(effectType == Multiplicative ? 1 : 0), mStackableType(stackableType), mEffectType(effectType) @@ -314,6 +315,7 @@ bool AttributeModifiersEffect::tick() } Attribute::Attribute(const std::vector<struct AttributeInfoType> &type) + : mBase(0) { LOG_DEBUG("Construction of new attribute with '" << type.size() << "' layers."); for (unsigned int i = 0; i < type.size(); ++i) |