Skip to content

Commit 633911c

Browse files
committed
patch 2
1 parent 687a9ca commit 633911c

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

.github/workflows/yue_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
- name: Download Yuescript and unzip yue
2727
run: |
28-
wget https://github.com/pigpigyyy/Yuescript/releases/download/v0.23.6/yue-linux-x86_64.zip
28+
wget https://github.com/pigpigyyy/Yuescript/releases/download/v0.23.8/yue-linux-x86_64.zip
2929
unzip yue-linux-x86_64.zip
3030
rm yue-linux-x86_64.zip
3131

lua/autorun/client/!dynamic-light-controller-entities.yue

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -101,22 +101,23 @@ do
101101

102102
PRE_HOOK )
103103

104-
Add( "PlayerSwitchWeapon", addonName, ( _, __, entity ) ->
105-
if entity.DLightController
106-
return
104+
Add( "PlayerSwitchWeapon", addonName, ( _, old, new ) ->
105+
dlight = old.__beam_dlight
106+
if dlight and IsValid( dlight )
107+
dlight\Remove!
107108

108-
dlight = entity.__dlight
109+
dlight = old.__dlight
109110
if dlight and IsValid( dlight )
110111
dlight\Remove!
111112

112-
bdlight = entity.__beam_dlight
113-
if bdlight and IsValid( dlight )
114-
bdlight\Remove!
113+
dlight = new.__dlight
114+
if dlight and IsValid( dlight )
115+
dlight\Remove!
115116

116-
unless dlight_controllers_entities\GetBool! and IsValid( entity )
117+
unless dlight_controllers_entities\GetBool! and IsValid( new )
117118
return
118119

119-
className = GetClass( entity )
120+
className = GetClass( new )
120121
if blacklist[ className ]
121122
return
122123

@@ -130,11 +131,11 @@ do
130131

131132
dlight\SetEnabled( true )
132133

133-
if func( entity, dlight ) == false
134+
if func( new, dlight ) == false
134135
dlight\Remove!
135136
return
136137

137-
entity.__dlight = dlight
138+
new.__dlight = dlight
138139
dlight\Spawn!
139140
return
140141

@@ -155,13 +156,12 @@ Add( "EntityRemoved", addonName, ( entity, fullUpdate ) ->
155156

156157
entity.m_eFireDLight = nil
157158

158-
if entity\IsPlayer!
159-
dlight = entity.__beam_dlight
160-
if dlight
161-
if IsValid( dlight )
162-
dlight\Remove!
159+
dlight = entity.__beam_dlight
160+
if dlight
161+
if IsValid( dlight )
162+
dlight\Remove!
163163

164-
entity.__beam_dlight = nil
164+
entity.__beam_dlight = nil
165165

166166
PRE_HOOK )
167167

@@ -483,7 +483,10 @@ do
483483

484484
hook.Add "Think", addonName, ->
485485
for _, entity in Iterator!
486-
if IsValid( entity ) and entity\IsOnFire!
486+
unless IsValid( entity )
487+
return
488+
489+
if entity\IsOnFire!
487490
dlight = entity.m_eFireDLight
488491
if dlight and IsValid( dlight )
489492
continue

0 commit comments

Comments
 (0)