diff --git a/src/vbsp.py b/src/vbsp.py index d99b69221..8ac0ffb4d 100644 --- a/src/vbsp.py +++ b/src/vbsp.py @@ -508,9 +508,23 @@ def set_player_portalgun(vmf: VMF, info: corridor.Info) -> None: ) pgun_script['Template01'] = '__pgun_template' pgun_script['spawnflags'] = 2 + else: - # In coop we have not need to actually spawn portalguns. + # In coop we have not need to actually spawn portalguns. pgun_script['classname'] = 'logic_script' + # Make sure @portalman knows when players spawn + vmf.create_ent( + classname='comp_relay', + targetname='@on_player_spawn_2', + origin=ent_pos, + OnTrigger="@portalgunCallScriptFunctionon_oran_spawn0-1" + ) + vmf.create_ent( + classname='comp_relay', + targetname='@on_player_spawn_3', + origin=ent_pos, + OnTrigger="@portalgunCallScriptFunctionon_blue_spawn0-1" + ) # For Absolute Fizzler or otherwise, this fizzles portals on a # player remotely. @@ -528,6 +542,7 @@ def set_player_portalgun(vmf: VMF, info: corridor.Info) -> None: mat=consts.Tools.TRIGGER, ).solid) + # For removing portalguns from players. trig_stripper = vmf.create_ent( targetname='__pgun_weapon_strip', @@ -598,19 +613,19 @@ def set_player_portalgun(vmf: VMF, info: corridor.Info) -> None: '_mark_held_cube()', )) - if info.is_sp: - logic_auto.add_out(Output( - 'OnMapSpawn', - '@portalgun', - 'RunScriptCode', - 'init({}, {}, {})'.format( - 'true' if blue_portal else 'false', - 'true' if oran_portal else 'false', - 'true' if has_btn_onoff else 'false', - ), - delay=0.1, - only_once=True, - )) + #Init @portalgun + logic_auto.add_out(Output( + 'OnMapSpawn', + '@portalgun', + 'RunScriptCode', + 'init({}, {}, {})'.format( + 'true' if blue_portal else 'false', + 'true' if oran_portal else 'false', + 'true' if has_btn_onoff else 'false', + ), + delay=0.1, + only_once=True, + )) # Shuts down various parts when you've reached the exit. import precomp.conditions.instances