1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-01 10:33:32 +02:00

Fix destroy(platforms), implement under different names

destroy(platforms) has been bugged since 2.0. The problem with it is
that it removes the platform entity, but doesn't remove its block. This
results in essentially turning the platorm invisible and stopping it
from moving.

This error should be fixed, but some levels (including my own) rely on
the invisible platform trick. So instead, the fixed version will be
implemented under a different name, destroy(moving).

There's also another problem with destroy(platforms), which is that the
name is misleading and it doesn't additionally destroy disappearing
platforms. I would also fix this, but in order to not run the risk of
breakage, it will have to be implemented under a different name, too. So
this will be destroy(disappear). As an added benefit, it's also more
granular to have platform-destroying functions under different names
than it is to consolidate them under the same name.
This commit is contained in:
Misa 2020-09-07 21:17:01 -07:00 committed by Misa Elizabeth Kai
parent bca8d39bd7
commit 08971b3311

View File

@ -187,10 +187,17 @@ void scriptclass::run(void)
for(size_t edi=0; edi<obj.entities.size(); edi++){
if(obj.entities[edi].type==11) obj.disableentity(edi);
}
}else if(words[1]=="platforms"){
}else if(words[1]=="platforms"||words[1]=="moving"){
bool fixed=words[1]=="moving";
for(size_t edi=0; edi<obj.entities.size(); edi++){
if(fixed) obj.disableblockat(obj.entities[edi].xp, obj.entities[edi].yp);
if(obj.entities[edi].rule==2 && obj.entities[edi].animate==100) obj.disableentity(edi);
}
}else if(words[1]=="disappear"){
for(size_t edi=0; edi<obj.entities.size(); edi++){
obj.disableblockat(obj.entities[edi].xp, obj.entities[edi].yp);
if(obj.entities[edi].type==2 && obj.entities[edi].rule==3) obj.disableentity(edi);
}
}
}
if (words[0] == "customiftrinkets")