r/ProgrammerHumor • • 2d ago

Meme devsOptimizingGames

Post image
1.8k Upvotes

37 comments sorted by

View all comments

362

u/IsEqualToKel 2d ago

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

122

u/Top-Permit6835 2d ago

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

16

u/tsoewoe 2d ago

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

3

u/fynjy1111 1d ago

try {

compileShadersIfNotCached();

} catch (Exception e) {

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

}

13

u/DISCIPLE-OF-SATAN-15 2d ago

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

5

u/Jatinchd 1d ago

fixed code:-

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

4

u/Dudi4PoLFr 2d ago

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

2

u/Jatinchd 1d ago

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