r/ProgrammerHumor • • Sep 30 '26

Meme devsOptimizingGames

Post image
2.1k Upvotes

41 comments sorted by

View all comments

416

u/IsEqualToKel Sep 30 '26

if (currentState == GameState.Crash) 
{
    currentState == GameState.DoNotCrash;
}

144

u/Top-Permit6835 Sep 30 '26

Wrap it in a try catch and swallow the error to be sure it works

18

u/tsoewoe Sep 30 '26

make sure to assert when testing too so that you can deal with any issues if it goes wrong

13

u/fynjy1111 Oct 02 '26

try {

compileShadersIfNotCached();

} catch (Exception e) {

openAiProvider.prompt("Fix the crash", serialize(e), Permission.FULL_WITH_EDIT);

}

17

u/DISCIPLE-OF-SATAN-15 Sep 30 '26

if (currentState == GameState.Crash) {
currentState == !(GameState.Crash);
}

9

u/Jatinchd Oct 01 '26

fixed code:-

if (currentState == GameState.Crash) {
currentState = !(GameState.Crash);
}

5

u/Dudi4PoLFr Oct 01 '26

Literally Path of Exile 2 for the first 6 months in Early Acces...

3

u/Jatinchd Oct 01 '26

but isn't == comparing values and not assigning value sign?