mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-01-05 15:11:16 +00:00
Fix bug where replies to unknown players went to the wrong place
This commit is contained in:
parent
787a5331c8
commit
e676979630
4 changed files with 6 additions and 1 deletions
Binary file not shown.
|
@ -126,7 +126,7 @@ void ns_coopnet_update(void) {
|
|||
static int ns_coopnet_network_send(u8 localIndex, void* address, u8* data, u16 dataLength) {
|
||||
if (!coopnet_is_connected()) { return 1; }
|
||||
//if (gCurLobbyId == 0) { return 2; }
|
||||
u64 userId = ns_coopnet_get_id(localIndex);
|
||||
u64 userId = coopnet_raw_get_id(localIndex);
|
||||
if (localIndex == 0 && address != NULL) { userId = *(u64*)address; }
|
||||
coopnet_send_to(userId, data, dataLength);
|
||||
|
||||
|
|
|
@ -75,6 +75,10 @@ void coopnet_set_local_user_id(uint64_t userId) {
|
|||
sLocalUserId = userId;
|
||||
}
|
||||
|
||||
s64 coopnet_raw_get_id(u8 localIndex) {
|
||||
return (s64)sNetworkUserIds[localIndex];
|
||||
}
|
||||
|
||||
s64 ns_coopnet_get_id(u8 localIndex) {
|
||||
if (localIndex == 0) { return (s64)sLocalUserId; }
|
||||
return (s64)sNetworkUserIds[localIndex];
|
||||
|
|
|
@ -12,6 +12,7 @@ void coopnet_set_user_id(uint8_t localIndex, uint64_t userId);
|
|||
uint64_t coopnet_get_local_user_id(void);
|
||||
void coopnet_set_local_user_id(uint64_t userId);
|
||||
|
||||
s64 coopnet_raw_get_id(u8 localIndex);
|
||||
s64 ns_coopnet_get_id(u8 localIndex);
|
||||
void ns_coopnet_save_id(u8 localIndex, s64 networkId);
|
||||
void ns_coopnet_clear_id(u8 localIndex);
|
||||
|
|
Loading…
Reference in a new issue