1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-28 15:38:30 +02:00
Commit Graph

3 Commits

Author SHA1 Message Date
Info Teddy
4e952450d5 Prevent the game from thinking horizontal warp lines are cyan crewmates (#87)
* Add entity type attribute checks to getcrewman()

This means that the game is no longer able to target other non-crewmate
entities when it looks for a crewmate.

This has actually happened in practice. A command like
position(cyan,above) could position the text box above a horizontal warp
line instead of the intended crewmate.

This is because getcrewman() previously only checked the rule attributes
of entities, and if their rule happened to be 6 or 7. Usually this
corresponds with crewmates being unflipped or flipped, respectively.

But warp lines' rules overlap with rules 6 and 7. If a warp line is
vertical, its rule is 5, and if it is horizontal, its rule is 7.

Now, usually, this wouldn't be an issue, but getcrewman() does a color
check as well. And for cyan, that is color 0. However, if an entity
doesn't use a color, it just defaults to color 0. So, getcrewman() found
an entity with a rule of 7 and a color of 0. This must mean it's a cyan
crewmate! But, well, it's actually just a horizontal warp line.

This commit prevents the above from happening.
2020-01-15 23:55:53 -05:00
Marvin Scholz
64fd50be6f Simplify std::vector initializations
Resizing the vector does the same thing that the loops did, it changes
the size for the vector and initializes it with default-constructed
elements (or 0 or its equivalent for POD types).

Where a specific value is needed, it is set with the second
parameter of resize().
2020-01-12 10:29:17 -05:00
Ethan Lee
f7c0321b71 Hello WWWWWWorld! 2020-01-08 10:37:50 -05:00