Fixed saving/loading of DynOS model pack settings

This commit is contained in:
MysterD 2022-03-12 17:00:06 -08:00
parent 4b0c0241e0
commit da97153336
3 changed files with 34 additions and 0 deletions

View file

@ -116,6 +116,7 @@
- [is_anim_at_end](#is_anim_at_end)
- [is_anim_past_end](#is_anim_past_end)
- [is_anim_past_frame](#is_anim_past_frame)
- [mario_can_bubble](#mario_can_bubble)
- [mario_facing_downhill](#mario_facing_downhill)
- [mario_floor_is_slippery](#mario_floor_is_slippery)
- [mario_floor_is_slope](#mario_floor_is_slope)
@ -2288,6 +2289,26 @@ The `reliable` field will ensure that the packet arrives, but should be used spa
<br />
## [mario_can_bubble](#mario_can_bubble)
### Lua Example
`local boolValue = mario_can_bubble(m)`
### Parameters
| Field | Type |
| ----- | ---- |
| m | [MarioState](structs.md#MarioState) |
### Returns
- `bool`
### C Prototype
`bool mario_can_bubble(struct MarioState* m);`
[:arrow_up_small:](#)
<br />
## [mario_facing_downhill](#mario_facing_downhill)
### Lua Example

View file

@ -252,6 +252,7 @@ static void dynos_pack_read(char** tokens, UNUSED int numTokens) {
if (numTokens < 3) { return; }
char fullPackName[256] = { 0 };
for (int i = 1; i < numTokens - 1; i++) {
if (i != 1) { strncat(fullPackName, " ", 255); }
strncat(fullPackName, tokens[i], 255);
}

View file

@ -975,6 +975,17 @@ int smlua_func_is_anim_past_frame(lua_State* L) {
return 1;
}
int smlua_func_mario_can_bubble(lua_State* L) {
if(!smlua_functions_valid_param_count(L, 1)) { return 0; }
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
if (!gSmLuaConvertSuccess) { return 0; }
lua_pushboolean(L, mario_can_bubble(m));
return 1;
}
int smlua_func_mario_facing_downhill(lua_State* L) {
if(!smlua_functions_valid_param_count(L, 2)) { return 0; }
@ -8198,6 +8209,7 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "is_anim_at_end", smlua_func_is_anim_at_end);
smlua_bind_function(L, "is_anim_past_end", smlua_func_is_anim_past_end);
smlua_bind_function(L, "is_anim_past_frame", smlua_func_is_anim_past_frame);
smlua_bind_function(L, "mario_can_bubble", smlua_func_mario_can_bubble);
smlua_bind_function(L, "mario_facing_downhill", smlua_func_mario_facing_downhill);
smlua_bind_function(L, "mario_floor_is_slippery", smlua_func_mario_floor_is_slippery);
smlua_bind_function(L, "mario_floor_is_slope", smlua_func_mario_floor_is_slope);