Get the extension properly
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 8 Sep 2010 17:04:24 +0000 (20:04 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 8 Sep 2010 17:04:24 +0000 (20:04 +0300)
data/qcsrc/server/cl_client.qc

index 021cf9e..1905968 100644 (file)
@@ -426,12 +426,12 @@ string setmodel_state()
        // set the proper belly model depending on how full we are\r
        string newmodel_name, newmodel_extension, applymodel;\r
 \r
-       tokenizebyseparator(self.playermodel, ".");\r
-       newmodel_name = argv(0);\r
-       newmodel_extension = argv(1);\r
+       // 4 is the extension length\r
+       newmodel_name = substring(self.playermodel, 0, strlen(self.playermodel) - 4);\r
+       newmodel_extension = substring(self.playermodel, strlen(self.playermodel) - 4, 4);\r
 \r
        if(self.stomach_load)\r
-               applymodel = strcat(newmodel_name, "_state", ftos(floor(self.stomach_load)), ".", newmodel_extension);\r
+               applymodel = strcat(newmodel_name, "_state", ftos(floor(self.stomach_load)), newmodel_extension);\r
        else\r
                applymodel = self.playermodel;\r
 \r