Skip to content

Commit

Permalink
Fix some templates getting removed
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSpen210 committed Jan 21, 2017
1 parent d806dd7 commit 18e9f09
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
13 changes: 0 additions & 13 deletions dev/dependancies.txt

This file was deleted.

20 changes: 11 additions & 9 deletions src/conditions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,16 +1087,17 @@ def import_template(
added - it's passed a list of names, and should return a list of ones to use.
"""
import vbsp
temp_name, visgroup_ids = parse_temp_name(temp_name)
temp_name, chosen_groups = parse_temp_name(temp_name)
visgroups = get_template(temp_name)
orig_world = [] # type: List[List[Solid]]
orig_detail = [] # type: List[List[Solid]]
orig_over = [] # type: List[Entity]

chosen_groups = visgroup_ids.union(visgroup_choose(
chosen_groups.update(visgroup_choose(
# Skip the '' visgroup in the callback.
filter(None, visgroups.keys()),
), ('', )) # '' = no visgroup, always used.
))
chosen_groups.add('') # '' = no visgroup, always used.

for group in chosen_groups:
world, detail, over = visgroups[group]
Expand All @@ -1116,7 +1117,11 @@ def import_template(
]:
for orig_list in orig_lists:
for old_brush in orig_list:
brush = old_brush.copy(map=VMF, side_mapping=id_mapping, keep_vis=False)
brush = old_brush.copy(
map=VMF,
side_mapping=id_mapping,
keep_vis=False,
)
brush.localise(origin, angles)
new_list.append(brush)

Expand Down Expand Up @@ -1149,11 +1154,6 @@ def import_template(
# Don't let the overlays get retextured too!
vbsp.IGNORED_OVERLAYS.add(new_overlay)

# Don't let these get retextured normally - that should be
# done by retexture_template(), if at all!
for brush in new_world + new_detail:
vbsp.IGNORED_FACES.update(brush.sides)

if force_type is TEMP_TYPES.detail:
new_detail.extend(new_world)
new_world.clear()
Expand All @@ -1168,6 +1168,8 @@ def import_template(
detail_ent = VMF.create_ent(
classname='func_detail'
)
# Don't let this be touched later..
vbsp.IGNORED_BRUSH_ENTS.add(detail_ent)
detail_ent.solids = new_detail
if not add_to_map:
detail_ent.remove()
Expand Down
3 changes: 3 additions & 0 deletions src/vbsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1843,6 +1843,9 @@ def change_brush():
if vbsp_options.get(bool, 'remove_pedestal_plat'):
# Remove the pedestal platforms
for ent in VMF.by_class['func_detail']:
if ent in IGNORED_BRUSH_ENTS:
continue

for side in ent.sides():
if side.mat.casefold() == 'plastic/plasticwall004a':
VMF.remove_ent(ent)
Expand Down

0 comments on commit 18e9f09

Please sign in to comment.