give clients access to mod incompatible tags (#296)

* rerun autogen

* give clients access to mod incompatible tags

And fix a crash when warping to the cake end picture
This commit is contained in:
Isaac0-dev 2023-02-28 02:22:31 +10:00 committed by GitHub
parent 1e175b5ce7
commit eeae1f0f38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View File

@ -48,7 +48,7 @@ static void ScanPacksFolder(SysPath _DynosPacksFolder) {
// If pack folder exists, add it to the pack list
SysPath _PackFolder = fstring("%s/%s", _DynosPacksFolder.c_str(), _DynosPacksEnt->d_name);
if (fs_sys_dir_exists(_PackFolder.c_str())) {
struct PackData* _Pack = DynOS_Pack_Add(_PackFolder);
DynOS_Pack_Add(_PackFolder);
DynOS_Actor_GeneratePack(_PackFolder);
DynOS_Tex_GeneratePack(_PackFolder, _PackFolder, false);
}

View File

@ -14,6 +14,7 @@
#include "pc/lua/smlua_hooks.h"
#include "pc/utils/misc.h"
#include "pc/debuglog.h"
#include "include/course_table.h"
/**
* This file contains the code that processes the scene graph for rendering.
@ -282,7 +283,7 @@ void patch_mtx_interpolated(f32 delta) {
// calculate outside of for loop to reduce overhead
// technically this is improper use of mtxf functions, but coop doesn't target N64
bool translateCamSpace = (gMtxTblSize > 0) && sCameraNode && (sCameraNode->matrixPtr != NULL) && (sCameraNode->matrixPtrPrev != NULL);
if (translateCamSpace) {
if (translateCamSpace && gCurrCourseNum != COURSE_CAKE_END) {
mtxf_inverse(camTranfInv.m, *sCameraNode->matrixPtr);
mtxf_inverse(prevCamTranfInv.m, *sCameraNode->matrixPtrPrev);
}

View File

@ -52,6 +52,9 @@ void network_send_mod_list(void) {
u16 nameLength = strlen(mod->name);
if (nameLength > 31) { nameLength = 31; }
u16 incompatibleLength = strlen(mod->incompatible);
if (incompatibleLength > 31) { incompatibleLength = 31; }
u16 relativePathLength = strlen(mod->relativePath);
u64 modSize = mod->size;
@ -60,6 +63,8 @@ void network_send_mod_list(void) {
packet_write(&p, &i, sizeof(u16));
packet_write(&p, &nameLength, sizeof(u16));
packet_write(&p, mod->name, sizeof(u8) * nameLength);
packet_write(&p, &incompatibleLength, sizeof(u16));
packet_write(&p, mod->incompatible, sizeof(u8) * incompatibleLength);
packet_write(&p, &relativePathLength, sizeof(u16));
packet_write(&p, mod->relativePath, sizeof(u8) * relativePathLength);
packet_write(&p, &modSize, sizeof(u64));
@ -179,6 +184,19 @@ void network_receive_mod_list_entry(struct Packet* p) {
packet_read(p, name, nameLength * sizeof(u8));
mod->name = strdup(name);
// get incompatible length
u16 incompatibleLength = 0;
packet_read(p, &incompatibleLength, sizeof(u16));
if (incompatibleLength > 31) {
LOG_ERROR("Received name with invalid length!");
return;
}
// get incompatible
char incompatible[32] = { 0 };
packet_read(p, incompatible, incompatibleLength * sizeof(u8));
mod->incompatible = strdup(incompatible);
// get other fields
u16 relativePathLength = 0;
packet_read(p, &relativePathLength, sizeof(u16));