Skip to content

Commit

Permalink
Re-move bounds checks out of core engine per request
Browse files Browse the repository at this point in the history
  • Loading branch information
kevansevans committed Oct 16, 2024
1 parent 0dbff4a commit d7fc6a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/gamedata/r_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include "r_sky.h"
#include "p_terrain.h"
#include "p_effect.h"
#include "vm.h"

#include "hwrenderer/data/buffers.h"

Expand Down Expand Up @@ -1032,13 +1031,11 @@ struct sector_t

void SetPlaneReflectivity(int pos, double val)
{
if (pos < 0 || pos > 1) ThrowAbortException(X_ARRAY_OUT_OF_BOUNDS, "pos must be either 0 or 1");
reflect[pos] = val;
}

double GetPlaneReflectivity(int pos)
{
if (pos < 0 || pos > 1) ThrowAbortException(X_ARRAY_OUT_OF_BOUNDS, "pos must be either 0 or 1");
return reflect[pos];
}

Expand Down
2 changes: 2 additions & 0 deletions src/scripting/vmthunks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Sector, SetXOffset, SetXOffset)

static void SetPlaneReflectivity(sector_t* self, int pos, double val)
{
if (pos < 0 || pos > 1) ThrowAbortException(X_ARRAY_OUT_OF_BOUNDS, "pos must be either 0 or 1");
self->SetPlaneReflectivity(pos, val);
}

Expand All @@ -885,6 +886,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Sector, SetXOffset, SetXOffset)

static double GetPlaneReflectivity(sector_t* self, int pos)
{
if (pos < 0 || pos > 1) ThrowAbortException(X_ARRAY_OUT_OF_BOUNDS, "pos must be either 0 or 1");
return self->GetPlaneReflectivity(pos);
}

Expand Down

0 comments on commit d7fc6a1

Please sign in to comment.