proAdhoc: Don't crash on a DISCONNECT for an unknown IP in GameMode

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-09 15:31:55 +02:00
1 parent c354bae00d
commit 04a72c0e03
1 file changed
+7 -4
+7 -4
View File
@@ -1672,11 +1672,14 @@ int friendFinder() {
if (adhocctlCurrentMode == ADHOCCTL_MODE_GAMEMODE) {
auto peer = findFriendByIP(packet->ip);
for (auto& gma : replicaGameModeAreas)
if (isMacMatch(&gma.mac, &peer->mac_addr)) {
gma.updateTimestamp = 0;
break;
if (peer) {
for (auto& gma : replicaGameModeAreas) {
if (isMacMatch(&gma.mac, &peer->mac_addr)) {
gma.updateTimestamp = 0;
break;
}
}
}
}
// Delete User by IP, should delete by MAC since IP can be shared (behind NAT) isn't?