mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-21 18:32:08 +00:00
Merge remote-tracking branch 'Public/next' into public_next
This commit is contained in:
commit
869748dfbf
5 changed files with 44 additions and 28 deletions
|
@ -1293,10 +1293,7 @@ static void readgametype(MYFILE *f, char *gtname)
|
|||
UINT32 wordgt = 0;
|
||||
for (j = 0; GAMETYPERULE_LIST[j]; j++)
|
||||
if (fastcmp(word, GAMETYPERULE_LIST[j])) {
|
||||
if (!j) // GTR_CAMPAIGN
|
||||
wordgt |= 1;
|
||||
else
|
||||
wordgt |= (1<<j);
|
||||
wordgt |= (1<<j);
|
||||
if (i || word2[0] == 'T' || word2[0] == 'Y')
|
||||
newgtrules |= wordgt;
|
||||
break;
|
||||
|
|
|
@ -268,10 +268,14 @@ static int patch_get(lua_State *L)
|
|||
#endif
|
||||
enum patch field = luaL_checkoption(L, 2, NULL, patch_opt);
|
||||
|
||||
// patches are CURRENTLY always valid, expected to be cached with PU_STATIC
|
||||
// this may change in the future, so patch.valid still exists
|
||||
if (!patch)
|
||||
// patches are invalidated when switching renderers
|
||||
if (!patch) {
|
||||
if (field == patch_valid) {
|
||||
lua_pushboolean(L, 0);
|
||||
return 1;
|
||||
}
|
||||
return LUA_ErrInvalid(L, "patch_t");
|
||||
}
|
||||
|
||||
switch (field)
|
||||
{
|
||||
|
|
|
@ -1001,15 +1001,35 @@ static void Polyobj_pushThing(polyobj_t *po, line_t *line, mobj_t *mo)
|
|||
//
|
||||
static void Polyobj_slideThing(mobj_t *mo, fixed_t dx, fixed_t dy)
|
||||
{
|
||||
if (mo->player) { // Do something similar to conveyor movement. -Red
|
||||
mo->player->cmomx += dx;
|
||||
mo->player->cmomy += dy;
|
||||
if (mo->player) { // Finally this doesn't suck eggs -fickle
|
||||
fixed_t cdx, cdy;
|
||||
|
||||
dx = FixedMul(dx, CARRYFACTOR);
|
||||
dy = FixedMul(dy, CARRYFACTOR);
|
||||
cdx = FixedMul(dx, FRACUNIT-CARRYFACTOR);
|
||||
cdy = FixedMul(dy, FRACUNIT-CARRYFACTOR);
|
||||
|
||||
mo->player->cmomx -= dx;
|
||||
mo->player->cmomy -= dy;
|
||||
if (mo->player->onconveyor == 1)
|
||||
{
|
||||
mo->momx += cdx;
|
||||
mo->momy += cdy;
|
||||
|
||||
// Multiple slides in the same tic, somehow
|
||||
mo->player->cmomx += cdx;
|
||||
mo->player->cmomy += cdy;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mo->player->onconveyor == 3)
|
||||
{
|
||||
mo->momx += cdx - mo->player->cmomx;
|
||||
mo->momy += cdy - mo->player->cmomy;
|
||||
}
|
||||
|
||||
mo->player->cmomx = cdx;
|
||||
mo->player->cmomy = cdy;
|
||||
}
|
||||
|
||||
dx = FixedMul(dx, FRACUNIT - mo->friction);
|
||||
dy = FixedMul(dy, FRACUNIT - mo->friction);
|
||||
|
||||
if (mo->player->pflags & PF_SPINNING && (mo->player->rmomx || mo->player->rmomy) && !(mo->player->pflags & PF_STARTDASH)) {
|
||||
#define SPINMULT 5184 // Consider this a substitute for properly calculating FRACUNIT-friction. I'm tired. -Red
|
||||
|
@ -1282,7 +1302,8 @@ static void Polyobj_rotateThings(polyobj_t *po, vertex_t origin, angle_t delta,
|
|||
{
|
||||
static INT32 pomovecount = 10000;
|
||||
INT32 x, y;
|
||||
angle_t deltafine = delta >> ANGLETOFINESHIFT;
|
||||
angle_t deltafine = (((po->angle + delta) >> ANGLETOFINESHIFT) - (po->angle >> ANGLETOFINESHIFT)) & FINEMASK;
|
||||
// This fineshift trickery replaces the old delta>>ANGLETOFINESHIFT; doing it this way avoids loss of precision causing objects to slide off -fickle
|
||||
|
||||
pomovecount++;
|
||||
|
||||
|
@ -1334,19 +1355,10 @@ static void Polyobj_rotateThings(polyobj_t *po, vertex_t origin, angle_t delta,
|
|||
oldxoff = mo->x-origin.x;
|
||||
oldyoff = mo->y-origin.y;
|
||||
|
||||
if (mo->player) // Hack to fix players sliding off of spinning polys -Red
|
||||
{
|
||||
fixed_t temp;
|
||||
newxoff = FixedMul(oldxoff, c)-FixedMul(oldyoff, s) - oldxoff;
|
||||
newyoff = FixedMul(oldyoff, c)+FixedMul(oldxoff, s) - oldyoff;
|
||||
|
||||
temp = FixedMul(oldxoff, c)-FixedMul(oldyoff, s);
|
||||
oldyoff = FixedMul(oldyoff, c)+FixedMul(oldxoff, s);
|
||||
oldxoff = temp;
|
||||
}
|
||||
|
||||
newxoff = FixedMul(oldxoff, c)-FixedMul(oldyoff, s);
|
||||
newyoff = FixedMul(oldyoff, c)+FixedMul(oldxoff, s);
|
||||
|
||||
Polyobj_slideThing(mo, newxoff-oldxoff, newyoff-oldyoff);
|
||||
Polyobj_slideThing(mo, newxoff, newyoff);
|
||||
|
||||
if (turnthings == 2 || (turnthings == 1 && !mo->player)) {
|
||||
mo->angle += delta;
|
||||
|
|
|
@ -12174,7 +12174,9 @@ void P_PlayerThink(player_t *player)
|
|||
|
||||
#ifdef POLYOBJECTS
|
||||
if (player->onconveyor == 1)
|
||||
player->cmomy = player->cmomx = 0;
|
||||
player->onconveyor = 3;
|
||||
else if (player->onconveyor == 3)
|
||||
player->cmomy = player->cmomx = 0;
|
||||
#endif
|
||||
|
||||
P_DoSuperStuff(player);
|
||||
|
|
|
@ -3463,6 +3463,7 @@ static boolean R_ProcessPatchableFields(skin_t *skin, char *stoken, char *value)
|
|||
GETFLAG(DASHMODE)
|
||||
GETFLAG(FASTEDGE)
|
||||
GETFLAG(MULTIABILITY)
|
||||
GETFLAG(NONIGHTSROTATION)
|
||||
#undef GETFLAG
|
||||
|
||||
else // let's check if it's a sound, otherwise error out
|
||||
|
|
Loading…
Reference in a new issue