mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-11-05 02:39:41 +01:00
Add bounds check for color of createentity number 55
I just spotted this one - if vy isn't bounds-checked, this causes bogus input from the createentity() script command to commit Undefined Behavior. Should've spotted this one when I was adding bounds checks to the rest of createentity() earlier, but at least it's fixed now.
This commit is contained in:
parent
6490af8783
commit
c8f4c37c88
1 changed files with 2 additions and 1 deletions
|
@ -2005,7 +2005,8 @@ void entityclass::createentity( float xp, float yp, int t, float vx /*= 0*/, flo
|
|||
//2 - colour
|
||||
entity.rule = 3;
|
||||
entity.type = 55;
|
||||
if(customcrewmoods[int(vy)]==1){
|
||||
if(INBOUNDS_ARR((int) vy, customcrewmoods)
|
||||
&& customcrewmoods[int(vy)]==1){
|
||||
entity.tile = 144;
|
||||
}else{
|
||||
entity.tile = 0;
|
||||
|
|
Loading…
Reference in a new issue