mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-22 03:55:11 +00:00
Merge branch 'unstable' of github.com:sm64ex-coop-dev/sm64ex-coop into unstable-dev
This commit is contained in:
commit
77a06e15b3
4 changed files with 38 additions and 12 deletions
|
@ -50,12 +50,6 @@ function act_spin_pound(m)
|
|||
|
||||
set_mario_animation(m, MARIO_ANIM_TWIRL)
|
||||
|
||||
if (m.input & INPUT_B_PRESSED) ~= 0 then
|
||||
mario_set_forward_vel(m, 10.0)
|
||||
m.vel.y = 35
|
||||
set_mario_action(m, ACT_DIVE, 0)
|
||||
end
|
||||
|
||||
local stepResult = perform_air_step(m, 0)
|
||||
if stepResult == AIR_STEP_LANDED then
|
||||
if should_get_stuck_in_ground(m) ~= 0 then
|
||||
|
@ -788,6 +782,11 @@ function wario_before_phys_step(m)
|
|||
end
|
||||
end
|
||||
|
||||
-- fixes the momentum bug
|
||||
if (m.action & ACT_HOLD_WATER_JUMP) then
|
||||
return
|
||||
end
|
||||
|
||||
-- faster holding item
|
||||
if m.heldObj ~= nil then
|
||||
m.vel.y = m.vel.y - 1
|
||||
|
|
|
@ -43,12 +43,15 @@ static void _debuglog_print_log(char* logType, char* filename) {
|
|||
}
|
||||
|
||||
#if defined(DEBUG) && defined(DISABLE_MODULE_LOG)
|
||||
#define LOG_DEBUG(...)
|
||||
#define LOG_INFO(...)
|
||||
#define LOG_ERROR(...) ( _debuglog_print_log("ERROR", __FILE__), printf(__VA_ARGS__), printf("\n") )
|
||||
#elif defined(DEBUG) && !defined(DISABLE_MODULE_LOG)
|
||||
#define LOG_INFO(...) ( _debuglog_print_log("INFO ", __FILE__), printf(__VA_ARGS__), printf("\n") )
|
||||
#define LOG_DEBUG(...) ( _debuglog_print_log("DEBUG", __FILE__), printf(__VA_ARGS__), printf("\n") )
|
||||
#define LOG_INFO(...) ( _debuglog_print_log("INFO", __FILE__), printf(__VA_ARGS__), printf("\n") )
|
||||
#define LOG_ERROR(...) ( _debuglog_print_log("ERROR", __FILE__), printf(__VA_ARGS__), printf("\n") )
|
||||
#else
|
||||
#define LOG_DEBUG(...)
|
||||
#define LOG_INFO(...)
|
||||
#define LOG_ERROR(...)
|
||||
#endif
|
||||
|
|
|
@ -59,13 +59,16 @@ static void _logfile_print_log(enum LogFileType logFileType, char* logType, char
|
|||
}
|
||||
|
||||
#if defined(DEBUG) && defined(DISABLE_MODULE_LOG)
|
||||
#define LOGFILE_INFO(_LFT, ...) ( _logfile_print_log(_LFT, "INFO ", __FILE__, __LINE__), fprintf(gLogFiles[_LFT].file, __VA_ARGS__), fprintf(gLogFiles[_LFT].file, "\n"))
|
||||
#define LOGFILE_DEBUG(_LFT, ...) ( _logfile_print_log(_LFT, "DEBUG", __FILE__, __LINE__), fprintf(gLogFiles[_LFT].file, __VA_ARGS__), fprintf(gLogFiles[_LFT].file, "\n"))
|
||||
#define LOGFILE_INFO(_LFT, ...) ( _logfile_print_log(_LFT, "INFO", __FILE__, __LINE__), fprintf(gLogFiles[_LFT].file, __VA_ARGS__), fprintf(gLogFiles[_LFT].file, "\n"))
|
||||
#define LOGFILE_ERROR(_LFT, ...) ( _logfile_print_log(_LFT, "ERROR", __FILE__, __LINE__), fprintf(gLogFiles[_LFT].file, __VA_ARGS__), fprintf(gLogFiles[_LFT].file, "\n"), LOG_ERROR(__VA_ARGS__))
|
||||
#elif defined(DEBUG) && !defined(DISABLE_MODULE_LOG)
|
||||
#define LOGFILE_INFO(_LFT, ...) ( _logfile_print_log(_LFT, "INFO ", __FILE__, __LINE__), fprintf(gLogFiles[_LFT].file, __VA_ARGS__), fprintf(gLogFiles[_LFT].file, "\n"), LOG_INFO (__VA_ARGS__))
|
||||
#define LOGFILE_DEBUG(_LFT, ...) ( _logfile_print_log(_LFT, "DEBUG", __FILE__, __LINE__), fprintf(gLogFiles[_LFT].file, __VA_ARGS__), fprintf(gLogFiles[_LFT].file, "\n"), LOG_DEBUG(__VA_ARGS__))
|
||||
#define LOGFILE_INFO(_LFT, ...) ( _logfile_print_log(_LFT, "INFO", __FILE__, __LINE__), fprintf(gLogFiles[_LFT].file, __VA_ARGS__), fprintf(gLogFiles[_LFT].file, "\n"), LOG_INFO (__VA_ARGS__))
|
||||
#define LOGFILE_ERROR(_LFT, ...) ( _logfile_print_log(_LFT, "ERROR", __FILE__, __LINE__), fprintf(gLogFiles[_LFT].file, __VA_ARGS__), fprintf(gLogFiles[_LFT].file, "\n"), LOG_ERROR(__VA_ARGS__))
|
||||
#else
|
||||
#define LOGFILE_INFO(_LFT, ...) ( _logfile_print_log(_LFT, "INFO ", __FILE__, __LINE__), fprintf(gLogFiles[_LFT].file, __VA_ARGS__), fprintf(gLogFiles[_LFT].file, "\n"))
|
||||
#define LOGFILE_DEBUG(_LFT, ...) ( _logfile_print_log(_LFT, "DEBUG", __FILE__, __LINE__), fprintf(gLogFiles[_LFT].file, __VA_ARGS__), fprintf(gLogFiles[_LFT].file, "\n"))
|
||||
#define LOGFILE_INFO(_LFT, ...) ( _logfile_print_log(_LFT, "INFO", __FILE__, __LINE__), fprintf(gLogFiles[_LFT].file, __VA_ARGS__), fprintf(gLogFiles[_LFT].file, "\n"))
|
||||
#define LOGFILE_ERROR(_LFT, ...) ( _logfile_print_log(_LFT, "ERROR", __FILE__, __LINE__), fprintf(gLogFiles[_LFT].file, __VA_ARGS__), fprintf(gLogFiles[_LFT].file, "\n"))
|
||||
#endif
|
||||
|
||||
|
|
|
@ -137,6 +137,11 @@ void network_send_area(struct NetworkPlayer* toNp) {
|
|||
void network_receive_area(struct Packet* p) {
|
||||
LOG_INFO("rx area");
|
||||
|
||||
if (p == NULL) {
|
||||
LOG_ERROR("rx area: the packet was NULL, failed to recieve the area.");
|
||||
return;
|
||||
}
|
||||
|
||||
// read level location
|
||||
s16 courseNum, actNum, levelNum, areaIndex;
|
||||
packet_read(p, &courseNum, sizeof(s16));
|
||||
|
@ -172,7 +177,7 @@ void network_receive_area(struct Packet* p) {
|
|||
// read removed sync ids
|
||||
area_remove_sync_ids_clear();
|
||||
packet_read(p, &sRemoveSyncIdsIndex, sizeof(u8));
|
||||
for (int i = 0; i < sRemoveSyncIdsIndex; i++) {
|
||||
for (s32 i = 0; i < sRemoveSyncIdsIndex; i++) {
|
||||
packet_read(p, &sRemoveSyncIds[i], sizeof(u8));
|
||||
struct SyncObject* so = &gSyncObjects[sRemoveSyncIds[i]];
|
||||
if (so->o != NULL) {
|
||||
|
@ -187,7 +192,7 @@ void network_receive_area(struct Packet* p) {
|
|||
packet_read(p, &respawnerCount, sizeof(u8));
|
||||
|
||||
// read respawners
|
||||
for (int i = 0; i < respawnerCount; i++) {
|
||||
for (s32 i = 0; i < respawnerCount; i++) {
|
||||
f32 posX, posY, posZ;
|
||||
packet_read(p, &posX, sizeof(f32));
|
||||
packet_read(p, &posY, sizeof(f32));
|
||||
|
@ -206,6 +211,22 @@ void network_receive_area(struct Packet* p) {
|
|||
|
||||
struct SyncObject* so = &gSyncObjects[syncId];
|
||||
|
||||
if (so == NULL) {
|
||||
LOG_ERROR("rx area: Sync object was NULL, Skipping respawner.");
|
||||
LOG_DEBUG("rx area debug: Sync Object DEBUG:\n\n \
|
||||
POS X: %f\n \
|
||||
POS Y: %f\n \
|
||||
POS Z: %f\n \
|
||||
BEHAVIOR PARAMS: 0x%X\n \
|
||||
RESPAWN MODEL: %i\n \
|
||||
MIN RESPAWN DIST: %f\n \
|
||||
RESPAWN BEHAVIOR: %u\n \
|
||||
SYNC ID: %u\n\n",
|
||||
posX, posY, posZ, behParams, respawnerModelToRespawn,
|
||||
respawnerMinSpawnDist, behaviorToRespawn, syncId);
|
||||
continue;
|
||||
}
|
||||
|
||||
LOG_INFO("rx respawner");
|
||||
if (syncId < RESERVED_IDS_SYNC_OBJECT_OFFSET) {
|
||||
struct Object* respawner = spawn_object_abs_with_rot(gMarioStates[0].marioObj, 0, MODEL_NONE, bhvRespawner, posX, posY, posZ, 0, 0, 0);
|
||||
|
|
Loading…
Reference in a new issue