fix some instances detecting vector component names to ONLY match _x, _y, _z, but...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 15 Feb 2011 06:31:53 +0000 (06:31 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 15 Feb 2011 06:31:53 +0000 (06:31 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10845 d7cf8633-e32d-0410-b094-e92efae38249

prvm_edict.c

index ca54439..aa34f78 100644 (file)
@@ -648,7 +648,7 @@ void PRVM_ED_Print(prvm_edict_t *ed, const char *wildcard_fieldname)
        {
                d = &prog->fielddefs[i];
                name = PRVM_GetString(d->s_name);
-               if (name[strlen(name)-2] == '_')
+               if(strlen(name) > 1 && name[strlen(name)-2] == '_' && (name[strlen(name)-1] == 'x' || name[strlen(name)-1] == 'y' || name[strlen(name)-1] == 'z')
                        continue;       // skip _x, _y, _z vars
 
                // Check Field Name Wildcard
@@ -732,7 +732,7 @@ void PRVM_ED_Write (qfile_t *f, prvm_edict_t *ed)
                if(developer_entityparsing.integer)
                        Con_Printf("PRVM_ED_Write: at entity %d field %s\n", PRVM_NUM_FOR_EDICT(ed), name);
 
-               if (name[strlen(name)-2] == '_')
+               if(strlen(name) > 1 && name[strlen(name)-2] == '_' && (name[strlen(name)-1] == 'x' || name[strlen(name)-1] == 'y' || name[strlen(name)-1] == 'z')
                        continue;       // skip _x, _y, _z vars
 
                v = (int *)(ed->fields.vp + d->ofs);