| 648 | } |
| 649 | |
| 650 | bool World::should_ask_before_closing() { |
| 651 | // If it's a client that didn't save to a file previously, we can ignore asking before quitting (probably don't intend to save anyway) |
| 652 | // If it's a server or a client, and the previous statement is false, we should always ask before quitting because the data could be modified by someone on the network |
| 653 | // If it's a local file, ask before quitting if we detect any local changes |
| 654 | // If on web version, don't ask before closing |
| 655 | #ifdef __EMSCRIPTEN__ |
| 656 | return false; |
| 657 | #else |
| 658 | if(netClient || netServer) |
| 659 | return !(netClient && filePath.empty()); |
| 660 | return hasUnsavedLocalChanges; |
| 661 | #endif |
| 662 | } |
| 663 | |
| 664 | void World::set_has_unsaved_local_changes(bool newHasUnsavedLocalChangesVal) { |
| 665 | bool oldHasUnsavedLocalChanges = hasUnsavedLocalChanges; |
no test coverage detected