r6080 - in branches/nexuiz-2.0: . data/qcsrc/common
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sun Mar 8 07:44:38 EDT 2009
Author: div0
Date: 2009-03-08 07:44:38 -0400 (Sun, 08 Mar 2009)
New Revision: 6080
Modified:
branches/nexuiz-2.0/.patchsets
branches/nexuiz-2.0/data/qcsrc/common/gamecommand.qc
Log:
as this is ABSOLUTELY safe:
r6079 | div0 | 2009-03-08 12:43:39 +0100 (Sun, 08 Mar 2009) | 2 lines
a new "fexists" rpn command to just check if a file exists and print no error if not
Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets 2009-03-08 11:43:39 UTC (rev 6079)
+++ branches/nexuiz-2.0/.patchsets 2009-03-08 11:44:38 UTC (rev 6080)
@@ -1,2 +1,2 @@
master = svn://svn.icculus.org/nexuiz/trunk
-revisions_applied = 1-6039,6044-6077
+revisions_applied = 1-6039,6044-6079
Modified: branches/nexuiz-2.0/data/qcsrc/common/gamecommand.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/common/gamecommand.qc 2009-03-08 11:43:39 UTC (rev 6079)
+++ branches/nexuiz-2.0/data/qcsrc/common/gamecommand.qc 2009-03-08 11:44:38 UTC (rev 6080)
@@ -602,7 +602,7 @@
s = substring(s, 1, 99999);
rpn_set(s);
tokenize_sane(command);
- } else if(rpncmd == "fexists_assert") {
+ } else if(rpncmd == "fexists_assert") {
s = rpn_pop();
if(!rpn_error)
{
@@ -614,6 +614,18 @@
rpn_error = TRUE;
}
}
+ } else if(rpncmd == "fexists") {
+ s = rpn_get();
+ if(!rpn_error)
+ {
+ f = fopen(s, FILE_READ);
+ if(f != -1) {
+ fclose(f);
+ rpn_setf(1);
+ } else {
+ rpn_setf(0);
+ }
+ }
} else if(rpncmd == "localtime") {
rpn_set(strftime(TRUE, rpn_get()));
} else if(rpncmd == "gmtime") {
More information about the nexuiz-commits
mailing list