mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-01-05 07:01:18 +00:00
Removed asserts (or made them soft)
This commit is contained in:
parent
8c0e3460f6
commit
ef12ff9e70
8 changed files with 56 additions and 60 deletions
|
@ -960,7 +960,6 @@ void cur_obj_update(void) {
|
|||
|
||||
// catch up the timer in total loop increments
|
||||
if (gCurrentObject->areaTimerType == AREA_TIMER_TYPE_LOOP) {
|
||||
assert(gCurrentObject->areaTimerDuration > 0);
|
||||
u32 difference = (gNetworkAreaTimer - gCurrentObject->areaTimer);
|
||||
if (difference >= gCurrentObject->areaTimerDuration) {
|
||||
u32 catchup = difference / gCurrentObject->areaTimerDuration;
|
||||
|
@ -971,7 +970,6 @@ void cur_obj_update(void) {
|
|||
|
||||
// catch up the timer for maximum
|
||||
if (gCurrentObject->areaTimerType == AREA_TIMER_TYPE_MAXIMUM) {
|
||||
assert(gCurrentObject->areaTimerDuration > 0);
|
||||
u32 difference = (gNetworkAreaTimer - gCurrentObject->areaTimer);
|
||||
if (difference >= gCurrentObject->areaTimerDuration) {
|
||||
if (gCurrentObject->areaTimer < 10) {
|
||||
|
|
|
@ -40,8 +40,6 @@ static void spiny_to_anim_cache(void) {
|
|||
spinyAnimCache = 0;
|
||||
} else if (o->oAnimations == (struct Animation**)spiny_seg5_anims_05016EAC) {
|
||||
spinyAnimCache = 1;
|
||||
} else {
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,7 +53,7 @@ static void spiny_from_anim_cache(void) {
|
|||
anim = (struct Animation**)spiny_seg5_anims_05016EAC;
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
break;
|
||||
}
|
||||
|
||||
if (anim != o->oAnimations) {
|
||||
|
|
|
@ -1865,7 +1865,7 @@ static u8 prevent_hang(u32 hangPreventionActions[], u8* hangPreventionIndex) {
|
|||
|
||||
// force the crash in debug mode
|
||||
#ifdef DEBUG
|
||||
assert(hangPreventionIndex == 0);
|
||||
SOFT_ASSERT(hangPreventionIndex == 0);
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -71,7 +71,7 @@ static bool smlua_sync_table_unwind(int syncTableIndex, int keyIndex) {
|
|||
lua_pop(L, 1);
|
||||
if (lst == LST_PLAYER) {
|
||||
struct LSTNetworkType* n = &sUnwoundLnts[sUnwoundLntsCount - 1];
|
||||
assert(n->type == LST_NETWORK_TYPE_INTEGER);
|
||||
SOFT_ASSERT_RETURN(n->type == LST_NETWORK_TYPE_INTEGER, false);
|
||||
n->value.integer = network_global_index_from_local(n->value.integer);
|
||||
}
|
||||
|
||||
|
@ -376,7 +376,7 @@ void smlua_set_sync_table_field_from_network(u64 seq, u16 modRemoteIndex, u16 ln
|
|||
// translate player index
|
||||
if (smlua_get_integer_field(-1, "_type") == LST_PLAYER) {
|
||||
lua_pop(L, 1); // pop wrong table
|
||||
assert(lntKeys[i].type == LST_NETWORK_TYPE_INTEGER);
|
||||
SOFT_ASSERT(lntKeys[i].type == LST_NETWORK_TYPE_INTEGER);
|
||||
lua_pushinteger(L, network_local_index_from_global(lntKeys[i].value.integer));
|
||||
lua_gettable(L, -2);
|
||||
}
|
||||
|
|
|
@ -41,48 +41,48 @@ void discord_fatal(int rc) {
|
|||
);
|
||||
exit(1);
|
||||
#else
|
||||
assert(rc != DiscordResult_ServiceUnavailable);
|
||||
assert(rc != DiscordResult_InvalidVersion);
|
||||
assert(rc != DiscordResult_LockFailed);
|
||||
assert(rc != DiscordResult_InternalError);
|
||||
assert(rc != DiscordResult_InvalidPayload);
|
||||
assert(rc != DiscordResult_InvalidCommand);
|
||||
assert(rc != DiscordResult_InvalidPermissions);
|
||||
assert(rc != DiscordResult_NotFetched);
|
||||
assert(rc != DiscordResult_NotFound);
|
||||
assert(rc != DiscordResult_Conflict);
|
||||
assert(rc != DiscordResult_InvalidSecret);
|
||||
assert(rc != DiscordResult_InvalidJoinSecret);
|
||||
assert(rc != DiscordResult_NoEligibleActivity);
|
||||
assert(rc != DiscordResult_InvalidInvite);
|
||||
assert(rc != DiscordResult_NotAuthenticated);
|
||||
assert(rc != DiscordResult_InvalidAccessToken);
|
||||
assert(rc != DiscordResult_ApplicationMismatch);
|
||||
assert(rc != DiscordResult_InvalidDataUrl);
|
||||
assert(rc != DiscordResult_InvalidBase64);
|
||||
assert(rc != DiscordResult_NotFiltered);
|
||||
assert(rc != DiscordResult_LobbyFull);
|
||||
assert(rc != DiscordResult_InvalidFilename);
|
||||
assert(rc != DiscordResult_InvalidFileSize);
|
||||
assert(rc != DiscordResult_InvalidEntitlement);
|
||||
assert(rc != DiscordResult_NotInstalled);
|
||||
assert(rc != DiscordResult_NotRunning);
|
||||
assert(rc != DiscordResult_InsufficientBuffer);
|
||||
assert(rc != DiscordResult_PurchaseCanceled);
|
||||
assert(rc != DiscordResult_InvalidGuild);
|
||||
assert(rc != DiscordResult_InvalidEvent);
|
||||
assert(rc != DiscordResult_InvalidChannel);
|
||||
assert(rc != DiscordResult_InvalidOrigin);
|
||||
assert(rc != DiscordResult_RateLimited);
|
||||
assert(rc != DiscordResult_OAuth2Error);
|
||||
assert(rc != DiscordResult_SelectChannelTimeout);
|
||||
assert(rc != DiscordResult_SelectVoiceForceRequired);
|
||||
assert(rc != DiscordResult_CaptureShortcutAlreadyListening);
|
||||
assert(rc != DiscordResult_UnauthorizedForAchievement);
|
||||
assert(rc != DiscordResult_InvalidGiftCode);
|
||||
assert(rc != DiscordResult_PurchaseError);
|
||||
assert(rc != DiscordResult_TransactionAborted);
|
||||
assert(rc == DiscordResult_Ok);
|
||||
SOFT_ASSERT(rc != DiscordResult_ServiceUnavailable);
|
||||
SOFT_ASSERT(rc != DiscordResult_InvalidVersion);
|
||||
SOFT_ASSERT(rc != DiscordResult_LockFailed);
|
||||
SOFT_ASSERT(rc != DiscordResult_InternalError);
|
||||
SOFT_ASSERT(rc != DiscordResult_InvalidPayload);
|
||||
SOFT_ASSERT(rc != DiscordResult_InvalidCommand);
|
||||
SOFT_ASSERT(rc != DiscordResult_InvalidPermissions);
|
||||
SOFT_ASSERT(rc != DiscordResult_NotFetched);
|
||||
SOFT_ASSERT(rc != DiscordResult_NotFound);
|
||||
SOFT_ASSERT(rc != DiscordResult_Conflict);
|
||||
SOFT_ASSERT(rc != DiscordResult_InvalidSecret);
|
||||
SOFT_ASSERT(rc != DiscordResult_InvalidJoinSecret);
|
||||
SOFT_ASSERT(rc != DiscordResult_NoEligibleActivity);
|
||||
SOFT_ASSERT(rc != DiscordResult_InvalidInvite);
|
||||
SOFT_ASSERT(rc != DiscordResult_NotAuthenticated);
|
||||
SOFT_ASSERT(rc != DiscordResult_InvalidAccessToken);
|
||||
SOFT_ASSERT(rc != DiscordResult_ApplicationMismatch);
|
||||
SOFT_ASSERT(rc != DiscordResult_InvalidDataUrl);
|
||||
SOFT_ASSERT(rc != DiscordResult_InvalidBase64);
|
||||
SOFT_ASSERT(rc != DiscordResult_NotFiltered);
|
||||
SOFT_ASSERT(rc != DiscordResult_LobbyFull);
|
||||
SOFT_ASSERT(rc != DiscordResult_InvalidFilename);
|
||||
SOFT_ASSERT(rc != DiscordResult_InvalidFileSize);
|
||||
SOFT_ASSERT(rc != DiscordResult_InvalidEntitlement);
|
||||
SOFT_ASSERT(rc != DiscordResult_NotInstalled);
|
||||
SOFT_ASSERT(rc != DiscordResult_NotRunning);
|
||||
SOFT_ASSERT(rc != DiscordResult_InsufficientBuffer);
|
||||
SOFT_ASSERT(rc != DiscordResult_PurchaseCanceled);
|
||||
SOFT_ASSERT(rc != DiscordResult_InvalidGuild);
|
||||
SOFT_ASSERT(rc != DiscordResult_InvalidEvent);
|
||||
SOFT_ASSERT(rc != DiscordResult_InvalidChannel);
|
||||
SOFT_ASSERT(rc != DiscordResult_InvalidOrigin);
|
||||
SOFT_ASSERT(rc != DiscordResult_RateLimited);
|
||||
SOFT_ASSERT(rc != DiscordResult_OAuth2Error);
|
||||
SOFT_ASSERT(rc != DiscordResult_SelectChannelTimeout);
|
||||
SOFT_ASSERT(rc != DiscordResult_SelectVoiceForceRequired);
|
||||
SOFT_ASSERT(rc != DiscordResult_CaptureShortcutAlreadyListening);
|
||||
SOFT_ASSERT(rc != DiscordResult_UnauthorizedForAchievement);
|
||||
SOFT_ASSERT(rc != DiscordResult_InvalidGiftCode);
|
||||
SOFT_ASSERT(rc != DiscordResult_PurchaseError);
|
||||
SOFT_ASSERT(rc != DiscordResult_TransactionAborted);
|
||||
SOFT_ASSERT(rc == DiscordResult_Ok);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -52,15 +52,15 @@ char* ns_discord_get_id_str(u8 localId) {
|
|||
}
|
||||
|
||||
void ns_discord_save_id(u8 localId, s64 networkId) {
|
||||
assert(localId > 0);
|
||||
assert(localId < MAX_PLAYERS);
|
||||
SOFT_ASSERT(localId > 0);
|
||||
SOFT_ASSERT(localId < MAX_PLAYERS);
|
||||
gNetworkUserIds[localId] = (networkId == 0) ? gNetworkUserIds[0] : networkId;
|
||||
LOGFILE_INFO(LFT_DISCORD, "saved user id %d == " DISCORD_ID_FORMAT, localId, gNetworkUserIds[localId]);
|
||||
}
|
||||
|
||||
void ns_discord_clear_id(u8 localId) {
|
||||
if (localId == 0) { return; }
|
||||
assert(localId < MAX_PLAYERS);
|
||||
SOFT_ASSERT(localId < MAX_PLAYERS);
|
||||
gNetworkUserIds[localId] = 0;
|
||||
LOGFILE_INFO(LFT_DISCORD, "cleared user id %d == " DISCORD_ID_FORMAT, localId, gNetworkUserIds[localId]);
|
||||
}
|
||||
|
|
|
@ -31,9 +31,9 @@ static void remove_node_from_list(struct PacketLinkedList* node) {
|
|||
|
||||
if (node->prev != NULL) { node->prev->next = node->next; }
|
||||
if (node->next != NULL) { node->next->prev = node->prev; }
|
||||
assert(node->p.addr != NULL);
|
||||
free(node->p.addr);
|
||||
free(node);
|
||||
|
||||
if (node->p.addr != NULL) { free(node->p.addr); }
|
||||
if (node != NULL) { free(node); }
|
||||
}
|
||||
|
||||
void network_forget_all_reliable(void) {
|
||||
|
|
|
@ -113,15 +113,15 @@ static char* ns_socket_get_id_str(u8 localId) {
|
|||
}
|
||||
|
||||
static void ns_socket_save_id(u8 localId, UNUSED s64 networkId) {
|
||||
assert(localId > 0);
|
||||
assert(localId < MAX_PLAYERS);
|
||||
SOFT_ASSERT(localId > 0);
|
||||
SOFT_ASSERT(localId < MAX_PLAYERS);
|
||||
addr[localId] = addr[0];
|
||||
LOG_INFO("saved addr for id %d", localId);
|
||||
}
|
||||
|
||||
static void ns_socket_clear_id(u8 localId) {
|
||||
if (localId == 0) { return; }
|
||||
assert(localId < MAX_PLAYERS);
|
||||
SOFT_ASSERT(localId < MAX_PLAYERS);
|
||||
memset(&addr[localId], 0, sizeof(struct sockaddr_in));
|
||||
LOG_INFO("cleared addr for id %d", localId);
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ static void ns_socket_update(void) {
|
|||
u16 dataLength = 0;
|
||||
u8 localIndex = UNKNOWN_LOCAL_INDEX;
|
||||
int rc = socket_receive(curSocket, &addr[0], data, PACKET_LENGTH + 1, &dataLength, &localIndex);
|
||||
assert(dataLength < PACKET_LENGTH);
|
||||
SOFT_ASSERT(dataLength < PACKET_LENGTH);
|
||||
if (rc != NO_ERROR) { break; }
|
||||
network_receive(localIndex, &addr[0], data, dataLength);
|
||||
} while (true);
|
||||
|
|
Loading…
Reference in a new issue