Skip to content

Commit da700ca

Browse files
committed
Simplified how brush entities are handled
1 parent fc4a74b commit da700ca

4 files changed

Lines changed: 7 additions & 12 deletions

File tree

SourceUtils.WebExport/Bsp/Entities.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public class BrushEntity : PvsEntity
127127
public int Model { get; set; }
128128
}
129129

130-
[Classname( "func_brush", "func_lod", "func_button", "func_door", "func_breakable", "func_wall" )]
130+
[Classname( "func_brush", "func_lod", "func_button", "func_door", "func_breakable", "func_wall", "func_tracktrain", "func_illusionary" )]
131131
private static BrushEntity InitBrushEntity( BrushEntity ent, ValveBsp.Entities.Entity value, MapParams mapParams )
132132
{
133133
if ( value.TargetName != null && mapParams.AreaPortalNames.Contains( value.TargetName ) ) return null;
@@ -147,6 +147,11 @@ private static BrushEntity InitBrushEntity( BrushEntity ent, ValveBsp.Entities.E
147147

148148
ent.Model = modelIndex;
149149

150+
if ( ent.GetType() == typeof(BrushEntity) )
151+
{
152+
ent.ClassName = "func_brush";
153+
}
154+
150155
return ent;
151156
}
152157

SourceUtils.WebExport/Resources/js/sourceutils.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ declare namespace SourceUtils {
9191
private readonly viewer;
9292
readonly isLeaf: boolean;
9393
readonly plane: Plane;
94-
readonly children: (BspNode | BspLeaf)[];
94+
readonly children: (BspLeaf | BspNode)[];
9595
constructor(viewer: MapViewer, info: IBspNode);
9696
private loadChild(value);
9797
findLeaves(target: BspLeaf[]): void;

SourceUtils.WebExport/Resources/js/sourceutils.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -550,11 +550,6 @@ var SourceUtils;
550550
pvsInst = new SourceUtils.Entities.Displacement(this, ent);
551551
break;
552552
case "func_brush":
553-
case "func_button":
554-
case "func_breakable":
555-
case "func_door":
556-
case "func_lod":
557-
case "func_wall":
558553
pvsInst = new SourceUtils.Entities.BrushEntity(this, ent);
559554
break;
560555
case "prop_static":

SourceUtils.WebExport/Resources/src/Map.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,6 @@ namespace SourceUtils {
132132
pvsInst = new Entities.Displacement(this, ent as Entities.IDisplacement);
133133
break;
134134
case "func_brush":
135-
case "func_button":
136-
case "func_breakable":
137-
case "func_door":
138-
case "func_lod":
139-
case "func_wall":
140135
pvsInst = new Entities.BrushEntity(this, ent as Entities.IBrushEntity);
141136
break;
142137
case "prop_static":

0 commit comments

Comments
 (0)