Revert "[Server] Add previous state to ON_RECORD_DYNAMIC"

This reverts commit 2ac01dc02a.

Commit 2ac01dc02a had confused the ON_RECORD_DYNAMIC event meant for custom items with a hypothetical ON_PLAYER_STATS_DYNAMIC event meant for dynamic player stats and had added functionality appropriate for the latter.

ON_PLAYER_STATS_DYNAMIC was never implemented because it would have caused too much event spam, with it constantly being triggered by any running player losing fatigue. If it ends up being added, the reverted lines from 2ac01dc02a should be added to it instead.
sol2-server-rewrite
David Cernat 7 years ago
parent 2ac01dc02a
commit b2a3dd9d60

@ -8,36 +8,17 @@ namespace mwmp
class ProcessorRecordDynamic final : public PlayerProcessor
{
public:
using OldDState = ESM::StatState<float>;
ProcessorRecordDynamic()
{
BPP_INIT(ID_RECORD_DYNAMIC)
Networking::get().getState().getState()->new_usertype<OldDState>("OldDState",
"base", &OldDState::mBase,
"current", &OldDState::mCurrent,
"mod", &OldDState::mMod,
"damage", &OldDState::mDamage,
"progress", &OldDState::mProgress);
}
void PreReading(PlayerPacket &packet, const std::shared_ptr<Player> &player) override
{
std::copy(std::begin(player->creatureStats.mDynamic),
std::end(player->creatureStats.mDynamic),
oldValues.begin()
);
}
void Do(PlayerPacket &packet, const std::shared_ptr<Player> &player) override
{
DEBUG_PRINTF(strPacketID.c_str());
Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_RECORD_DYNAMIC, true>(&oldValues, player);
Networking::get().getState().getEventCtrl().Call<CoreEvent::ON_RECORD_DYNAMIC>(player);
}
private:
std::array<OldDState, 3> oldValues;
};
}

Loading…
Cancel
Save