From 9882ceedf3b5986f971d521700ec91ac5ba50df4 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Mon, 17 Apr 2017 18:03:33 +0300 Subject: [PATCH] [General] Remove attackerGuid from mwmp::Attack because it is redundant --- apps/openmw/mwclass/npc.cpp | 1 - apps/openmw/mwmp/LocalPlayer.cpp | 2 -- components/openmw-mp/Base/BaseStructs.hpp | 1 - components/openmw-mp/Packets/Player/PacketPlayerAttack.cpp | 1 - 4 files changed, 5 deletions(-) diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index 43a370603..abd394290 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -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 diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 680135038..0c2f06c67 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -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(); diff --git a/components/openmw-mp/Base/BaseStructs.hpp b/components/openmw-mp/Base/BaseStructs.hpp index 54bfd1523..06b948fbd 100644 --- a/components/openmw-mp/Base/BaseStructs.hpp +++ b/components/openmw-mp/Base/BaseStructs.hpp @@ -9,7 +9,6 @@ namespace mwmp { public: RakNet::RakNetGUID targetGuid; - RakNet::RakNetGUID attackerGuid; char type; // 0 - melee, 1 - magic, 2 - throwable enum TYPE diff --git a/components/openmw-mp/Packets/Player/PacketPlayerAttack.cpp b/components/openmw-mp/Packets/Player/PacketPlayerAttack.cpp index c80c9fbab..eb055cc38 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerAttack.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerAttack.cpp @@ -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);