diff --git a/src/Components/Modules/Network.cpp b/src/Components/Modules/Network.cpp index 37ab799d..b0e652ee 100644 --- a/src/Components/Modules/Network.cpp +++ b/src/Components/Modules/Network.cpp @@ -121,7 +121,7 @@ namespace Components } bool Network::Address::isValid() { - return (this->getType() != Game::netadrtype_t::NA_BAD && this->getType() >= Game::netadrtype_t::NA_BOT && this->getType() <= Game::netadrtype_t::NA_IP); + return (this->getType() != Game::netadrtype_t::NA_BAD && this->getType() >= Game::netadrtype_t::NA_BOT && this->getType() <= Game::netadrtype_t::NA_IP && this->address.ip.full != 0); } void Network::Handle(const std::string& packet, Utils::Slot callback) { diff --git a/src/Components/Modules/RCon.cpp b/src/Components/Modules/RCon.cpp index a1597a0f..b1cc435b 100644 --- a/src/Components/Modules/RCon.cpp +++ b/src/Components/Modules/RCon.cpp @@ -25,9 +25,13 @@ namespace Components } else { - if (!RCon::Password.empty() && *reinterpret_cast(0xB2C540) >= 5) // Get our state + auto addr = reinterpret_cast(0xA5EA44); + if (!RCon::Password.empty()) { - Network::Address target(reinterpret_cast(0xA5EA44)); + Network::Address target(addr); + if (!target.isValid()) { + target = Party::Target(); + } if (target.isValid()) { @@ -107,9 +111,7 @@ namespace Components static std::string outputBuffer; outputBuffer.clear(); -#ifdef DEBUG Logger::Print("Executing RCon request from %s: %s\n", address.getCString(), command.data()); -#endif Logger::PipeOutput([](const std::string& output) {