mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Merge branch 'master' into damage-control
This commit is contained in:
commit
dd5fa80839
4 changed files with 10 additions and 31 deletions
|
@ -369,6 +369,8 @@ static int libd_drawScaled(lua_State *L)
|
|||
x = luaL_checkinteger(L, 1);
|
||||
y = luaL_checkinteger(L, 2);
|
||||
scale = luaL_checkinteger(L, 3);
|
||||
if (scale < 0)
|
||||
return luaL_error(L, "negative scale");
|
||||
patch = *((patch_t **)luaL_checkudata(L, 4, META_PATCH));
|
||||
flags = luaL_optinteger(L, 5, 0);
|
||||
if (!lua_isnoneornil(L, 6))
|
||||
|
|
|
@ -1675,6 +1675,7 @@ char *M_GetToken(const char *inputString)
|
|||
|| stringToUse[startPos] == '\r'
|
||||
|| stringToUse[startPos] == '\n'
|
||||
|| stringToUse[startPos] == '\0'
|
||||
|| stringToUse[startPos] == '"' // we're treating this as whitespace because SLADE likes adding it for no good reason
|
||||
|| inComment != 0)
|
||||
&& startPos < stringLength)
|
||||
{
|
||||
|
@ -1742,6 +1743,7 @@ char *M_GetToken(const char *inputString)
|
|||
&& stringToUse[endPos] != ','
|
||||
&& stringToUse[endPos] != '{'
|
||||
&& stringToUse[endPos] != '}'
|
||||
&& stringToUse[endPos] != '"' // see above
|
||||
&& inComment == 0)
|
||||
&& endPos < stringLength)
|
||||
{
|
||||
|
|
|
@ -2408,13 +2408,13 @@ static void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motyp
|
|||
delta2 = thingtop - (bottomheight + ((topheight - bottomheight)/2));
|
||||
if (topheight > mo->floorz && abs(delta1) < abs(delta2)
|
||||
&& !(rover->flags & FF_REVERSEPLATFORM)
|
||||
&& ((P_MobjFlip(mo)*mo->momz > 0) || (!(rover->flags & FF_PLATFORM)))) // In reverse gravity, only clip for FOFs that are intangible from their bottom (the "top" you're falling through) if you're coming from above ("below" in your frame of reference)
|
||||
&& ((P_MobjFlip(mo)*mo->momz >= 0) || (!(rover->flags & FF_PLATFORM)))) // In reverse gravity, only clip for FOFs that are intangible from their bottom (the "top" you're falling through) if you're coming from above ("below" in your frame of reference)
|
||||
{
|
||||
mo->floorz = topheight;
|
||||
}
|
||||
if (bottomheight < mo->ceilingz && abs(delta1) >= abs(delta2)
|
||||
&& !(rover->flags & FF_PLATFORM)
|
||||
&& ((P_MobjFlip(mo)*mo->momz > 0) || (!(rover->flags & FF_REVERSEPLATFORM)))) // In normal gravity, only clip for FOFs that are intangible from the top if you're coming from below
|
||||
&& ((P_MobjFlip(mo)*mo->momz >= 0) || (!(rover->flags & FF_REVERSEPLATFORM)))) // In normal gravity, only clip for FOFs that are intangible from the top if you're coming from below
|
||||
{
|
||||
mo->ceilingz = bottomheight;
|
||||
}
|
||||
|
|
33
src/p_spec.c
33
src/p_spec.c
|
@ -509,7 +509,7 @@ void P_ParseAnimationDefintion(SINT8 istexture, INT32 *i)
|
|||
animdefsToken = M_GetToken(NULL);
|
||||
if (animdefsToken == NULL)
|
||||
{
|
||||
I_Error("Error parsing TEXTURES lump: Unexpected end of file where \"%s\"'s animation speed should be", animdefs[*i].startname);
|
||||
I_Error("Error parsing ANIMDEFS lump: Unexpected end of file where \"%s\"'s animation speed should be", animdefs[*i].startname);
|
||||
}
|
||||
endPos = NULL;
|
||||
#ifndef AVOID_ERRNO
|
||||
|
@ -523,7 +523,7 @@ void P_ParseAnimationDefintion(SINT8 istexture, INT32 *i)
|
|||
#endif
|
||||
|| animSpeed < 0) // Number is not positive
|
||||
{
|
||||
I_Error("Error parsing TEXTURES lump: Expected a positive integer for \"%s\"'s animation speed, got \"%s\"", animdefs[*i].startname, animdefsToken);
|
||||
I_Error("Error parsing ANIMDEFS lump: Expected a positive integer for \"%s\"'s animation speed, got \"%s\"", animdefs[*i].startname, animdefsToken);
|
||||
}
|
||||
animdefs[*i].speed = animSpeed;
|
||||
Z_Free(animdefsToken);
|
||||
|
@ -6715,31 +6715,6 @@ static void Add_Scroller(INT32 type, fixed_t dx, fixed_t dy, INT32 control, INT3
|
|||
P_AddThinker(&s->thinker);
|
||||
}
|
||||
|
||||
/** Adds a wall scroller.
|
||||
* Scroll amount is rotated with respect to wall's linedef first, so that
|
||||
* scrolling towards the wall in a perpendicular direction is translated into
|
||||
* vertical motion, while scrolling along the wall in a parallel direction is
|
||||
* translated into horizontal motion.
|
||||
*
|
||||
* \param dx x speed of scrolling or its acceleration.
|
||||
* \param dy y speed of scrolling or its acceleration.
|
||||
* \param l Line whose front side will scroll.
|
||||
* \param control Sector whose heights control this scroller's effect
|
||||
* remotely, or -1 if there is no control sector.
|
||||
* \param accel Nonzero for an accelerative effect.
|
||||
* \sa Add_Scroller, P_SpawnScrollers
|
||||
*/
|
||||
static void Add_WallScroller(fixed_t dx, fixed_t dy, const line_t *l, INT32 control, INT32 accel)
|
||||
{
|
||||
fixed_t x = abs(l->dx), y = abs(l->dy), d;
|
||||
if (y > x)
|
||||
d = x, x = y, y = d;
|
||||
d = FixedDiv(x, FINESINE((tantoangle[FixedDiv(y, x) >> DBITS] + ANGLE_90) >> ANGLETOFINESHIFT));
|
||||
x = -FixedDiv(FixedMul(dy, l->dy) + FixedMul(dx, l->dx), d);
|
||||
y = -FixedDiv(FixedMul(dx, l->dy) - FixedMul(dy, l->dx), d);
|
||||
Add_Scroller(sc_side, x, y, control, *l->sidenum, accel, 0);
|
||||
}
|
||||
|
||||
/** Initializes the scrollers.
|
||||
*
|
||||
* \todo Get rid of all the magic numbers.
|
||||
|
@ -6822,7 +6797,7 @@ static void P_SpawnScrollers(void)
|
|||
case 502:
|
||||
for (s = -1; (s = P_FindLineFromLineTag(l, s)) >= 0 ;)
|
||||
if (s != (INT32)i)
|
||||
Add_WallScroller(dx, dy, lines+s, control, accel);
|
||||
Add_Scroller(sc_side, dx, dy, control, lines[s].sidenum[0], accel, 0);
|
||||
break;
|
||||
|
||||
case 505:
|
||||
|
@ -7425,7 +7400,7 @@ void T_Pusher(pusher_t *p)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (top < thing->z || referrer->floorheight > (thing->z + (thing->height >> 1)))
|
||||
if (top < thing->z || bottom > (thing->z + (thing->height >> 1)))
|
||||
continue;
|
||||
if (thing->z + thing->height > top)
|
||||
touching = true;
|
||||
|
|
Loading…
Reference in a new issue