From 5d0b9ef551ef23b3db8cd4f8661779d4f8ce39da Mon Sep 17 00:00:00 2001 From: ZTsukei Date: Mon, 27 Feb 2017 17:55:24 -0500 Subject: [PATCH] Friction updated. Added KARTSTUFF to lua. Added ->kartstuff to network syncing stuff (surprised it even worked before now???), also maybe items correctly reset at the end of level now. --- src/d_clisrv.c | 4 ++++ src/d_netcmd.c | 2 +- src/doomdef.h | 10 +++++----- src/g_game.c | 3 ++- src/k_kart.c | 2 +- src/lua_libs.h | 1 + src/lua_playerlib.c | 2 ++ src/lua_script.c | 1 + src/p_mobj.c | 2 +- src/p_spec.h | 2 +- 10 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 64a8c228..5d0b807e 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -517,6 +517,8 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i) for (j = 0; j < NUMPOWERS; ++j) rsp->powers[j] = (UINT16)SHORT(players[i].powers[j]); + for (j = 0; j < NUMKARTSTUFF; ++j) + rsp->kartstuff[j] = (UINT16)SHORT(players[i].kartstuff[j]); // SRB2kart // Score is resynched in the rspfirm resync packet rsp->health = 0; // resynched with mo health @@ -647,6 +649,8 @@ static void resynch_read_player(resynch_pak *rsp) for (j = 0; j < NUMPOWERS; ++j) players[i].powers[j] = (UINT16)SHORT(rsp->powers[j]); + for (j = 0; j < NUMKARTSTUFF; ++j) + players[i].kartstuff[j] = (UINT16)SHORT(rsp->kartstuff[j]); // SRB2kart // Score is resynched in the rspfirm resync packet players[i].health = rsp->health; diff --git a/src/d_netcmd.c b/src/d_netcmd.c index b97ac70b..fcb55db0 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -376,7 +376,7 @@ consvar_t cv_maxping = {"maxping", "0", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NUL #endif // Intermission time Tails 04-19-2002 static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NULL}}; -consvar_t cv_inttime = {"inttime", "20", CV_NETVAR, inttime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_inttime = {"inttime", "3000", CV_NETVAR, inttime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t advancemap_cons_t[] = {{0, "Off"}, {1, "Next"}, {2, "Random"}, {0, NULL}}; consvar_t cv_advancemap = {"advancemap", "Next", CV_NETVAR, advancemap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/doomdef.h b/src/doomdef.h index 3206856b..55c52bc9 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -143,16 +143,16 @@ extern FILE *logstream; #define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3 #ifdef DEVELOP #define VERSION 102 // Game version -#define SUBVERSION 0 // more precise version number +#define SUBVERSION 1 // more precise version number #define VERSIONSTRING "Development EXE" -#define VERSIONSTRINGW "v1.2.00" +#define VERSIONSTRINGW "v1.2.01" // most interface strings are ignored in development mode. // we use comprevision and compbranch instead. #else #define VERSION 102 // Game version -#define SUBVERSION 0 // more precise version number -#define VERSIONSTRING "DevEXE v1.2.00" -#define VERSIONSTRINGW L"v1.2.00" +#define SUBVERSION 1 // more precise version number +#define VERSIONSTRING "DevEXE v1.2.01" +#define VERSIONSTRINGW L"v1.2.01" // Hey! If you change this, add 1 to the MODVERSION below! // Otherwise we can't force updates! #endif diff --git a/src/g_game.c b/src/g_game.c index 95462446..0adccb78 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -199,7 +199,7 @@ UINT16 extralifetics = 4*TICRATE; // SRB2kart INT32 bootime = 7*TICRATE; INT32 mushroomtime = TICRATE + (TICRATE/3); -INT32 bonustime = 10*TICRATE; +INT32 bonustime = 8*TICRATE; INT32 gameovertics = 15*TICRATE; @@ -2119,6 +2119,7 @@ static inline void G_PlayerFinishLevel(INT32 player) p = &players[player]; memset(p->powers, 0, sizeof (p->powers)); + memset(p->kartstuff, 0, sizeof (p->kartstuff)); // SRB2kart p->ringweapons = 0; p->mo->flags2 &= ~MF2_SHADOW; // cancel invisibility diff --git a/src/k_kart.c b/src/k_kart.c index d5693f2a..66697a9b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -792,7 +792,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) // If the roulette finishes or the player presses BT_ATTACK, stop the roulette and calculate the item. // I'm returning via the exact opposite, however, to forgo having another bracket embed. Same result either way, I think. // Finally, if you get past this check, now you can actually start calculating what item you get. - if (!(player->kartstuff[k_itemroulette] > (TICRATE*3)-1 || ((cmd->buttons & BT_ATTACK) && player->kartstuff[k_itemroulette] > ((TICRATE*2)/3)-1))) + if (!(player->kartstuff[k_itemroulette] > (TICRATE*3)-1)) // || ((cmd->buttons & BT_ATTACK) && player->kartstuff[k_itemroulette] > ((TICRATE*2)/3)-1))) return; // Initializes existing values diff --git a/src/lua_libs.h b/src/lua_libs.h index 931cf62d..4f8b3474 100644 --- a/src/lua_libs.h +++ b/src/lua_libs.h @@ -30,6 +30,7 @@ extern lua_State *gL; #define META_TICCMD "TICCMD_T*" #define META_SKIN "SKIN_T*" #define META_POWERS "PLAYER_T*POWERS" +#define META_KARTSTUFF "PLAYER_T*KARTSTUFF" #define META_SOUNDSID "SKIN_T*SOUNDSID" #define META_VERTEX "VERTEX_T*" diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 29bcd736..06cc69e0 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -128,6 +128,8 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->ringweapons); else if (fastcmp(field,"powers")) LUA_PushUserdata(L, plr->powers, META_POWERS); + else if (fastcmp(field,"kartstuff")) + LUA_PushUserdata(L, plr->kartstuff, META_KARTSTUFF); else if (fastcmp(field,"pflags")) lua_pushinteger(L, plr->pflags); else if (fastcmp(field,"panim")) diff --git a/src/lua_script.c b/src/lua_script.c index acb30682..b9a6b5f2 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -434,6 +434,7 @@ void LUA_InvalidatePlayer(player_t *player) return; LUA_InvalidateUserdata(player); LUA_InvalidateUserdata(player->powers); + LUA_InvalidateUserdata(player->kartstuff); LUA_InvalidateUserdata(&player->cmd); } diff --git a/src/p_mobj.c b/src/p_mobj.c index 5a6dfb81..6708ddf3 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8514,7 +8514,7 @@ void P_RemoveSavegameMobj(mobj_t *mobj) } static CV_PossibleValue_t respawnitemtime_cons_t[] = {{1, "MIN"}, {300, "MAX"}, {0, NULL}}; -consvar_t cv_itemrespawntime = {"respawnitemtime", "30", CV_NETVAR|CV_CHEAT, respawnitemtime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_itemrespawntime = {"respawnitemtime", "1", CV_NETVAR|CV_CHEAT, respawnitemtime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_itemrespawn = {"respawnitem", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t flagtime_cons_t[] = {{0, "MIN"}, {300, "MAX"}, {0, NULL}}; consvar_t cv_flagtime = {"flagtime", "30", CV_NETVAR|CV_CHEAT, flagtime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/p_spec.h b/src/p_spec.h index a8f9ac49..b7454829 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -393,7 +393,7 @@ typedef struct } friction_t; // Friction defines. -#define ORIG_FRICTION (0xE8 << (FRACBITS-8)) ///< Original value. +#define ORIG_FRICTION 62914 //(0xE8 << (FRACBITS-8)) ///< Original value. #define ORIG_FRICTION_FACTOR (8 << (FRACBITS-8)) ///< Original value. void T_Friction(friction_t *f);