Merge branch 'coop' of github.com:sm64ex-coop-dev/sm64ex-coop into coop

This commit is contained in:
MysterD 2023-04-20 11:21:24 -07:00
commit 60e88ed02c
10 changed files with 2 additions and 17 deletions

View File

@ -1725,7 +1725,6 @@
--- @field public maxPlayers integer
--- @field public playerInteractions PlayerInteractions
--- @field public playerKnockbackStrength integer
--- @field public shareLives integer
--- @field public skipIntro integer
--- @field public stayInLevelAfterStar integer

View File

@ -2185,7 +2185,6 @@
| maxPlayers | `integer` | |
| playerInteractions | [enum PlayerInteractions](constants.md#enum-PlayerInteractions) | |
| playerKnockbackStrength | `integer` | |
| shareLives | `integer` | |
| skipIntro | `integer` | |
| stayInLevelAfterStar | `integer` | |

View File

@ -428,9 +428,6 @@ void mario_set_bubbled(struct MarioState* m) {
set_mario_action(m, ACT_BUBBLED, 0);
if (m->numLives != -1) {
m->numLives--;
if (gServerSettings.shareLives) {
network_send_death();
}
}
m->healCounter = 0;
m->hurtCounter = 31;
@ -503,7 +500,7 @@ s32 mario_get_floor_class(struct MarioState *m) {
}
// Crawling allows Mario to not slide on certain steeper surfaces.
if (m->action == ACT_CRAWLING && m->floor->normal.y > 0.5f && floorClass == SURFACE_CLASS_DEFAULT) {
if (m->action == ACT_CRAWLING && m->floor && m->floor->normal.y > 0.5f && floorClass == SURFACE_CLASS_DEFAULT) {
floorClass = SURFACE_CLASS_NOT_SLIPPERY;
}

View File

@ -115,7 +115,6 @@ bool configCameraAnalog = true;
bool configCameraMouse = false;
#endif
bool configSkipIntro = 0;
bool configShareLives = 0;
bool configEnableCheats = 0;
bool configBubbleDeath = true;
unsigned int configAmountofPlayers = 16;
@ -249,7 +248,6 @@ static const struct ConfigOption options[] = {
{.name = "coop_custom_palette_cap", .type = CONFIG_TYPE_COLOR , .colorValue = &configCustomPalette.parts[CAP]},
{.name = "coop_stay_in_level_after_star", .type = CONFIG_TYPE_UINT , .uintValue = &configStayInLevelAfterStar},
{.name = "coop_singleplayer_pause", .type = CONFIG_TYPE_BOOL , .boolValue = &configSingleplayerPause},
{.name = "share_lives", .type = CONFIG_TYPE_BOOL , .boolValue = &configShareLives},
{.name = "disable_popups", .type = CONFIG_TYPE_BOOL , .boolValue = &configDisablePopups},
#if defined(DEVELOPMENT)
{.name = "lua_profiler", .type = CONFIG_TYPE_BOOL , .boolValue = &configLuaProfiler},

View File

@ -76,7 +76,6 @@ extern bool configCameraAnalog;
#endif
extern bool configHUD;
extern bool configSkipIntro;
extern bool configShareLives;
extern bool configEnableCheats;
extern bool configBubbleDeath;
extern unsigned int configAmountofPlayers;

View File

@ -60,7 +60,6 @@ void djui_panel_host_settings_create(struct DjuiBase* caller) {
djui_selectionbox_create(body, DLANG(HOST_SETTINGS, ON_STAR_COLLECTION), lChoices, 3, &configStayInLevelAfterStar, NULL);
djui_checkbox_create(body, DLANG(HOST_SETTINGS, SKIP_INTRO_CUTSCENE), &configSkipIntro, NULL);
djui_checkbox_create(body, DLANG(HOST_SETTINGS, SHARE_LIVES), &configShareLives, NULL);
djui_checkbox_create(body, DLANG(HOST_SETTINGS, ENABLE_CHEATS), &configEnableCheats, NULL);
djui_checkbox_create(body, DLANG(HOST_SETTINGS, BUBBLE_ON_DEATH), &configBubbleDeath, NULL);

View File

@ -1888,7 +1888,7 @@ static struct LuaObjectField sRayIntersectionInfoFields[LUA_RAY_INTERSECTION_INF
{ "surface", LVT_COBJECT_P, offsetof(struct RayIntersectionInfo, surface), false, LOT_SURFACE },
};
#define LUA_SERVER_SETTINGS_FIELD_COUNT 11
#define LUA_SERVER_SETTINGS_FIELD_COUNT 10
static struct LuaObjectField sServerSettingsFields[LUA_SERVER_SETTINGS_FIELD_COUNT] = {
{ "bubbleDeath", LVT_U8, offsetof(struct ServerSettings, bubbleDeath), false, LOT_NONE },
{ "enableCheats", LVT_U8, offsetof(struct ServerSettings, enableCheats), false, LOT_NONE },
@ -1898,7 +1898,6 @@ static struct LuaObjectField sServerSettingsFields[LUA_SERVER_SETTINGS_FIELD_COU
{ "maxPlayers", LVT_U8, offsetof(struct ServerSettings, maxPlayers), false, LOT_NONE },
{ "playerInteractions", LVT_S32, offsetof(struct ServerSettings, playerInteractions), false, LOT_NONE },
{ "playerKnockbackStrength", LVT_U8, offsetof(struct ServerSettings, playerKnockbackStrength), false, LOT_NONE },
{ "shareLives", LVT_U8, offsetof(struct ServerSettings, shareLives), false, LOT_NONE },
{ "skipIntro", LVT_U8, offsetof(struct ServerSettings, skipIntro), false, LOT_NONE },
{ "stayInLevelAfterStar", LVT_U8, offsetof(struct ServerSettings, stayInLevelAfterStar), false, LOT_NONE },
};

View File

@ -69,7 +69,6 @@ struct ServerSettings gServerSettings = {
.playerInteractions = PLAYER_INTERACTIONS_SOLID,
.playerKnockbackStrength = 25,
.skipIntro = 0,
.shareLives = 0,
.enableCheats = 0,
.bubbleDeath = 1,
.enablePlayersInLevelDisplay = 1,
@ -110,7 +109,6 @@ bool network_init(enum NetworkType inNetworkType, bool reconnecting) {
gServerSettings.playerKnockbackStrength = configPlayerKnockbackStrength;
gServerSettings.stayInLevelAfterStar = configStayInLevelAfterStar;
gServerSettings.skipIntro = configSkipIntro;
gServerSettings.shareLives = configShareLives;
gServerSettings.enableCheats = configEnableCheats;
gServerSettings.bubbleDeath = configBubbleDeath;
gServerSettings.maxPlayers = configAmountofPlayers;

View File

@ -68,7 +68,6 @@ struct ServerSettings {
u8 playerKnockbackStrength;
u8 stayInLevelAfterStar;
u8 skipIntro;
u8 shareLives;
u8 enableCheats;
u8 bubbleDeath;
u8 enablePlayersInLevelDisplay;

View File

@ -115,7 +115,6 @@ void network_send_join(struct Packet* joinRequestPacket) {
packet_write(&p, &gServerSettings.playerKnockbackStrength, sizeof(u8));
packet_write(&p, &gServerSettings.stayInLevelAfterStar, sizeof(u8));
packet_write(&p, &gServerSettings.skipIntro, sizeof(u8));
packet_write(&p, &gServerSettings.shareLives, sizeof(u8));
packet_write(&p, &gServerSettings.enableCheats, sizeof(u8));
packet_write(&p, &gServerSettings.bubbleDeath, sizeof(u8));
packet_write(&p, &gServerSettings.headlessServer, sizeof(u8));
@ -166,7 +165,6 @@ void network_receive_join(struct Packet* p) {
packet_read(p, &gServerSettings.playerKnockbackStrength, sizeof(u8));
packet_read(p, &gServerSettings.stayInLevelAfterStar, sizeof(u8));
packet_read(p, &gServerSettings.skipIntro, sizeof(u8));
packet_read(p, &gServerSettings.shareLives, sizeof(u8));
packet_read(p, &gServerSettings.enableCheats, sizeof(u8));
packet_read(p, &gServerSettings.bubbleDeath, sizeof(u8));
packet_read(p, &gServerSettings.headlessServer, sizeof(u8));