* misc_model _target and group entity _targetname key aliases for baking the model into entity

helps when targetname key is not wanted on an entity, as changing its behavour
crosslinking of keys versions works, underscored version has priority
This commit is contained in:
Garux
2023-07-05 14:45:05 +06:00
parent 363c63b5d2
commit 1e909131be
2 changed files with 3 additions and 3 deletions

View File

@@ -1274,7 +1274,7 @@ void AddTriangleModels( entity_t& eparent ){
targetName = "";
}
else{ /* misc_model entities target non-worldspawn brush model entities */
if ( !eparent.read_keyvalue( targetName, "targetname" ) ) {
if ( !eparent.read_keyvalue( targetName, "_targetname", "targetname" ) ) {
return;
}
}
@@ -1291,7 +1291,7 @@ void AddTriangleModels( entity_t& eparent ){
}
/* ydnar: added support for md3 models on non-worldspawn models */
if ( !strEqual( e.valueForKey( "target" ), targetName ) ) {
if ( const char *target = ""; e.read_keyvalue( target, "_target", "target" ), !strEqual( target, targetName ) ) {
continue;
}