diff options
Diffstat (limited to 'src/net/tmwa/beingrecv.cpp')
-rw-r--r-- | src/net/tmwa/beingrecv.cpp | 66 |
1 files changed, 19 insertions, 47 deletions
diff --git a/src/net/tmwa/beingrecv.cpp b/src/net/tmwa/beingrecv.cpp index 012042b00..04c2562d5 100644 --- a/src/net/tmwa/beingrecv.cpp +++ b/src/net/tmwa/beingrecv.cpp @@ -1,11 +1,11 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -113,16 +113,11 @@ void BeingRecv::processBeingChangeLook2(Net::MessageIn &msg) msg.readBeingId("being id")); const uint8_t type = msg.readUInt8("type"); - int id2 = 0; const int16_t id = msg.readInt16("id1"); - if (type == 2) + int id2 = msg.readInt16("id2"); + if (type != 2) { - id2 = msg.readInt16("id2"); - } - else - { - msg.readInt16("id2"); id2 = 1; } @@ -375,10 +370,7 @@ void BeingRecv::processPlayerUpdate1(Net::MessageIn &msg) dstBeing->setActionTime(tick_time); - dstBeing->setStatusEffectOpitons(option, - opt1, - opt2, - opt3); + dstBeing->setStatusEffectOptions(option, opt1, opt2, opt3); BLOCK_END("BeingRecv::processPlayerMoveUpdate") } @@ -517,10 +509,7 @@ void BeingRecv::processPlayerUpdate2(Net::MessageIn &msg) dstBeing->setLevel(level); dstBeing->setActionTime(tick_time); - dstBeing->setStatusEffectOpitons(option, - opt1, - opt2, - opt3); + dstBeing->setStatusEffectOptions(option, opt1, opt2, opt3); BLOCK_END("BeingRecv::processPlayerMoveUpdate") } @@ -689,10 +678,7 @@ void BeingRecv::processPlayerMove(Net::MessageIn &msg) if (dstBeing->getType() != ActorType::Player) dstBeing->setActionTime(tick_time); - dstBeing->setStatusEffectOpitons(option, - opt1, - opt2, - opt3); + dstBeing->setStatusEffectOptions(option, opt1, opt2, opt3); if (dstBeing->getType() == ActorType::Player) dstBeing->setMoveTime(); @@ -908,10 +894,7 @@ void BeingRecv::processBeingVisible(Net::MessageIn &msg) msg.readUInt8("unknown"); msg.readUInt8("unknown"); - dstBeing->setStatusEffectOpitons(option, - opt1, - opt2, - opt3); + dstBeing->setStatusEffectOptions(option, opt1, opt2, opt3); BLOCK_END("BeingRecv::processBeingVisibleOrMove") } @@ -1111,10 +1094,7 @@ void BeingRecv::processBeingMove(Net::MessageIn &msg) msg.readUInt8("unknown"); msg.readUInt8("unknown"); - dstBeing->setStatusEffectOpitons(option, - opt1, - opt2, - opt3); + dstBeing->setStatusEffectOptions(option, opt1, opt2, opt3); BLOCK_END("BeingRecv::processBeingVisibleOrMove") } @@ -1245,10 +1225,10 @@ void BeingRecv::processBeingChangeDirection(Net::MessageIn &msg) void BeingRecv::processPlayerStatusChange(Net::MessageIn &msg) { - BLOCK_START("BeingRecv::processPlayerStop") + BLOCK_START("BeingRecv::processPlayerStatusChange") if (actorManager == nullptr) { - BLOCK_END("BeingRecv::processPlayerStop") + BLOCK_END("BeingRecv::processPlayerStatusChange") return; } @@ -1270,10 +1250,8 @@ void BeingRecv::processPlayerStatusChange(Net::MessageIn &msg) const uint32_t option = msg.readInt16("option"); msg.readUInt8("Unused?"); - dstBeing->setStatusEffectOpitons(option, - opt1, - opt2); - BLOCK_END("BeingRecv::processPlayerStop") + dstBeing->setStatusEffectOptions(option, opt1, opt2); + BLOCK_END("BeingRecv::processPlayerStatusChange") } void BeingRecv::processBeingResurrect(Net::MessageIn &msg) @@ -1360,17 +1338,16 @@ void BeingRecv::processBeingSelfEffect(Net::MessageIn &msg) } const BeingId id = msg.readBeingId("being id"); + const int effectType = msg.readInt32("effect type"); + Being *const being = actorManager->findBeing(id); if (being == nullptr) { - DEBUGLOGSTR("insible player?"); - msg.readInt32("effect type"); + DEBUGLOGSTR("invisible player?"); BLOCK_END("BeingRecv::processBeingSelfEffect") return; } - const int effectType = msg.readInt32("effect type"); - if (ParticleEngine::enabled) effectManager->trigger(effectType, being, 0); @@ -1399,16 +1376,11 @@ void BeingRecv::processIpResponse(Net::MessageIn &msg) Being *const dstBeing = actorManager->findBeing( msg.readBeingId("being id")); + const int ipAddress = msg.readInt32("ip address"); if (dstBeing != nullptr) - { - const std::string ip = ipToString(msg.readInt32("ip address")); - dstBeing->setIp(ip); - } + dstBeing->setIp(ipToString(ipAddress)); else - { - msg.readInt32("ip address"); DEBUGLOGSTR("invisible player?"); - } BLOCK_END("BeingRecv::processIpResponse") } |