Skip to content

Commit

Permalink
Correct handling of 3d floor plane texture getting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marisa Kirisame committed Jul 7, 2019
1 parent 9b74828 commit dd2a795
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/scripting/vmthunks.cpp
Expand Up @@ -1388,14 +1388,18 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Sector, SetXOffset, SetXOffset)

static int Get3DFloorTexture(F3DFloor *self, int pos)
{
return self->model->GetTexture(1-pos).GetIndex();
if ( pos )
return self->bottom.texture->GetIndex();
return self->top.texture->GetIndex();
}

DEFINE_ACTION_FUNCTION_NATIVE(_F3DFloor, GetTexture, Get3DFloorTexture)
{
PARAM_SELF_STRUCT_PROLOGUE(F3DFloor);
PARAM_INT(pos);
ACTION_RETURN_INT(self->model->GetTexture(1-pos).GetIndex());
if ( pos )
ACTION_RETURN_INT(self->bottom.texture->GetIndex());
ACTION_RETURN_INT(self->top.texture->GetIndex());
}

//===========================================================================
Expand Down

0 comments on commit dd2a795

Please sign in to comment.