GameMaker [SOLVED]switches

A

anomalous

Guest
The new IDE doesn't like basically all of my switches in my current project.

switch(input){
case(e_room_type.overland):

where e_room_type.overland is an enumerator.

Is that not allowable/advisable Using enumerators seemed to help auto correct/complete and keep things tidy. Unfortunately its a lot of code that it suddenly dislikes...
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Enums should be fine, as they evaluate to a constant value. Since you don't actually post the error you are getting, the only thing I can think of is the use of () around the enum case... I've only ever seen cases done like this:

Code:
switch(VAL)
{
case enum.val:
    // do something
    break;
case "string":
    // Do something
    break;
case 100:
    // Do something
    break;
}
So remove those and see what happens. :)
 
Top