mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 05:21:16 +00:00
Add bounds check
This commit is contained in:
parent
275635adc5
commit
4b3273b229
1 changed files with 3 additions and 0 deletions
|
@ -40,6 +40,7 @@
|
|||
#include "r_sky.h"
|
||||
#include "p_terrain.h"
|
||||
#include "p_effect.h"
|
||||
#include "vm.h"
|
||||
|
||||
#include "hwrenderer/data/buffers.h"
|
||||
|
||||
|
@ -1031,11 +1032,13 @@ public:
|
|||
|
||||
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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue