mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- grate stuff
This commit is contained in:
parent
574a24aded
commit
b9906ad5ce
1 changed files with 9 additions and 8 deletions
|
@ -4675,29 +4675,30 @@ int DoStayOnFloor(DSWActor* actor)
|
|||
int DoGrating(DSWActor* actor)
|
||||
{
|
||||
int dir;
|
||||
const int GRATE_FACTOR = 3;
|
||||
const int GRATE_FACTORI = 3;
|
||||
const double GRATE_FACTOR = GRATE_FACTORI * maptoworld;
|
||||
|
||||
// reduce to 0 to 3 value
|
||||
dir = actor->int_ang() >> 9;
|
||||
|
||||
int x = 0, y = 0;
|
||||
DVector2 v(0, 0);
|
||||
if ((dir & 1) == 0)
|
||||
{
|
||||
if (dir == 0)
|
||||
x = 2 * GRATE_FACTOR;
|
||||
v.X = 2 * GRATE_FACTOR;
|
||||
else
|
||||
x = -2 * GRATE_FACTOR;
|
||||
v.X = -2 * GRATE_FACTOR;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dir == 1)
|
||||
y= 2 * GRATE_FACTOR;
|
||||
v.Y= 2 * GRATE_FACTOR;
|
||||
else
|
||||
y= -2 * GRATE_FACTOR;
|
||||
v.Y= -2 * GRATE_FACTOR;
|
||||
}
|
||||
actor->add_int_pos({ x, y, 0 });
|
||||
actor->spr.pos += v;
|
||||
|
||||
actor->spr.hitag -= GRATE_FACTOR;
|
||||
actor->spr.hitag -= GRATE_FACTORI;
|
||||
|
||||
if (actor->spr.hitag <= 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue