[General] Remove attackerGuid from mwmp::Attack because it is redundant

0.6.1
David Cernat 8 years ago
parent 340ad09c97
commit 9882ceedf3

@ -930,7 +930,6 @@ namespace MWClass
{
mwmp::Attack *attack = &mwmp::Main::get().getLocalPlayer()->attack;
attack->damage = damage;
attack->attackerGuid = mwmp::Main::get().getLocalPlayer()->guid;
attack->targetGuid = victimPlayer->guid;
attack->knockdown = getCreatureStats(ptr).getKnockedDown();
mwmp::Main::get().getLocalPlayer()->sendAttack(mwmp::Attack::MELEE); // todo: make this sensitive to different weapon types

@ -532,7 +532,6 @@ void LocalPlayer::updateAttackState(bool forceUpdate)
{
const string &spell = MWBase::Environment::get().getWindowManager()->getSelectedSpell();
attack.attackerGuid = guid;
attack.type = Attack::MAGIC;
attack.pressed = true;
attack.spellId = spell;
@ -1197,7 +1196,6 @@ void LocalPlayer::prepareAttack(Attack::TYPE type, bool state)
attack.knockdown = false;
attack.block = false;
attack.targetGuid = RakNet::RakNetGUID();
attack.attackerGuid = guid;
getNetworking()->getPlayerPacket(ID_PLAYER_ATTACK)->setPlayer(this);
getNetworking()->getPlayerPacket(ID_PLAYER_ATTACK)->Send();

@ -9,7 +9,6 @@ namespace mwmp
{
public:
RakNet::RakNetGUID targetGuid;
RakNet::RakNetGUID attackerGuid;
char type; // 0 - melee, 1 - magic, 2 - throwable
enum TYPE

@ -16,7 +16,6 @@ void PacketPlayerAttack::Packet(RakNet::BitStream *bs, bool send)
{
PlayerPacket::Packet(bs, send);
RW(player->attack.attackerGuid, send);
RW(player->attack.targetGuid, send);
RW(player->attack.spellId, send);

Loading…
Cancel
Save