Since you're comparing with == 'door', two things that can bite with a name method in Game_Event:
- @event.name is the RPG::Event's own string, not a copy. == and downcase are fine, but if you ever use a bang method on it (name.downcase!, name.strip!, name[0] = '') you're editing the map data for the rest of the session, and every other event that reads that name afterwards gets the mutated value. Do name = @event.name.dup first if you need to change it.
- In RMXP the editor stores event names that start with a space with a special character (byte 0xA1, shows as ยก) instead of a normal space, so the leading space doesn't get trimmed. A name like " Door" comes out as "\xA1Door", which neither strip nor downcase removes, and the comparison in KK20's conditional branch quietly fails. A cheap guard:
def name
@event.name.sub(/\A\xA1/, '')
end
or just never start these names with a space. If a "door" event ever doesn't react, that's the first thing I'd check.