why is this bizarre error happening?

Started by bx83, Fri 07/02/2020 22:14:22

Previous topic - Next topic

bx83

Code: ags
function getZFactor()
{
  int x=0;
  int scale=player.Scaling;
  
  if (scale==0) {
    return 0;
  } else {
    switch (scale) {
      1:    x=0; break;
      2:    x=-1; break;
      3:    x=-2; break;
...


"GlobalScript.asc(6): Error (line 6): Invalid keyword '1' in switch statement block"

But... switch *only* takes integers?? So....?
Completely confuzzled.

Snarky


bx83

...And that's why this is in beginners technical questions :P

Thanks :)

SMF spam blocked by CleanTalk