From 1e909131be2e716493e857be3bbd315ec3e7b595 Mon Sep 17 00:00:00 2001 From: Garux Date: Wed, 5 Jul 2023 14:45:05 +0600 Subject: [PATCH] * 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 --- docs/Complete_list_of_entity_keys.htm | 2 +- tools/quake3/q3map2/model.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Complete_list_of_entity_keys.htm b/docs/Complete_list_of_entity_keys.htm index 7fcf6d39..6ff39fd6 100644 --- a/docs/Complete_list_of_entity_keys.htm +++ b/docs/Complete_list_of_entity_keys.htm @@ -222,7 +222,7 @@ td.formatted_questions ol { margin-top: 0px; margin-bottom: 0px; }
  • spawnflags: 8 = when generating clipping planes, perform extrusion using the original normals from the model instead of per-triangle best axial normals
  • spawnflags: 16 = when generating clipping planes, perform extrusion using only up or down pointing normals (ideal for terrain)
  • spawnflags: 32 = turn vertex color from the model into alpha (for terrain blending)
  • -
  • target: points to brush entity to bake the model into
  • +
  • target, _target: points to brush entity with any of matching targetname/_targetname keys to bake the model into
  • On classname _skybox diff --git a/tools/quake3/q3map2/model.cpp b/tools/quake3/q3map2/model.cpp index b13fde36..10b933df 100644 --- a/tools/quake3/q3map2/model.cpp +++ b/tools/quake3/q3map2/model.cpp @@ -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; }