1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-28 15:38:30 +02: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:
Misa 2021-03-25 18:38:36 -07:00 committed by Ethan Lee
parent 6490af8783
commit c8f4c37c88

View File

@ -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;