From aa3153c9be487e9274376d0ae39a35dd57303668 Mon Sep 17 00:00:00 2001 From: black Date: Tue, 5 Feb 2008 16:20:23 +0000 Subject: [PATCH] Fix the VM's clientstate builtin to do a correct mapping between the client state and the menu's constants (now that the client state values have changed in DP itself). git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8074 d7cf8633-e32d-0410-b094-e92efae38249 --- prvm_cmds.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/prvm_cmds.c b/prvm_cmds.c index a50711bd..4f39cd0f 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -2198,7 +2198,22 @@ void VM_clientstate(void) { VM_SAFEPARMCOUNT(0,VM_clientstate); - PRVM_G_FLOAT(OFS_RETURN) = cls.state; + + switch( cls.state ) { + case ca_uninitialized: + case ca_dedicated: + PRVM_G_FLOAT(OFS_RETURN) = 0; + break; + case ca_disconnected: + PRVM_G_FLOAT(OFS_RETURN) = 1; + break; + case ca_connected: + PRVM_G_FLOAT(OFS_RETURN) = 2; + break; + default: + // should never be reached! + break; + } } /* -- 2.39.2