]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't show ToS dialog if the file can't be opened
authorFreddy <schro.sb@gmail.com>
Sat, 18 Apr 2020 15:08:33 +0000 (17:08 +0200)
committerFreddy <schro.sb@gmail.com>
Sat, 18 Apr 2020 15:08:33 +0000 (17:08 +0200)
qcsrc/menu/xonotic/dialog_termsofservice.qc

index e04b2fda68fc37d9de301cbe262dded7b3386b54..c925dbccd8611a629efd22435bb2bded2d818902 100644 (file)
@@ -37,14 +37,14 @@ void XonoticToSDialog_loadXonoticToS(entity me)
                 ToSText = line;
             }
         }
+        fclose(fh);
     }
-    fclose(fh);
     me.textBox.setText(me.textBox, ToSText);
 }
 
 bool XonoticToSDialog_shouldShow()
 {
-    return !autocvar__termsofservice_accepted;
+    return (fexists("TermsOfService") && !autocvar__termsofservice_accepted);
 }
 
 void XonoticToSDialog_fill(entity me)