YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
22 stars 8 forks source link

In-Game: game_set_speed() needs to catch and prevent setting a gamespeed_fps of 0 #7816

Open attic-stuff opened 6 days ago

attic-stuff commented 6 days ago

Description

if you [accidentally get the arguments for game_set_speed() the wrong way around], it sets gamespeed to 0 but runs the game at plaid.

Expected Change

it shouldn't do that >:[

Steps To Reproduce

  1. Start GameMaker
  2. Import moveandbreak-Dan.zip
  3. Run it (e.g., Windows VM)
  4. Observe the game is very happy to set itself to gamespeed 0 and so fps_real gets unlocked

How reliably can you recreate this issue using your steps above?

Always

Which version of GameMaker are you reporting this issue for?

2024.8.1 (Monthly)

Which platform(s) are you seeing the problem on?

Windows

Sample Package Attached?

Sample Project Added?

YYDan commented 4 days ago

Not sure why this is happening yet, but simply "moving a borderless window causes it to go to 0" is not true even in your sample project. If you comment out the two lines in your Step event which change the gamespeed, then no bug occurs.

YYDan commented 4 days ago

Okay, so it's nothing to do with borderless either ;)

This is very simply that your two calls to game_set_speed() have the two arguments the wrong way around and so this gives you 0 each time - e.g, you have game_set_speed(gamespeed_fps, 60); instead of game_set_speed(60, gamespeed_fps);.

We should change the function to not allow setting a gamespeed_fps that equals 0 (or any negative number, etc.). Probably with at least a debug message that this was disallowed, if not a full code error.

YYDan commented 4 days ago

Edited the report now

YYDan commented 4 days ago

Okay, so negative numbers are already caught and a code error shown: image

So this is just to determine if 0 should be allowed still or made into a code error this same way.

attic-stuff commented 4 days ago

lol good catch!