Improved critter.psc fix
This commit is contained in:
parent
5401437976
commit
d0512f2177
Binary file not shown.
@ -230,14 +230,14 @@ Event OnUpdateGameTime()
|
||||
DisableAndDelete(false)
|
||||
endEvent
|
||||
|
||||
Event OnLoad()
|
||||
bAttached = true
|
||||
endEvent
|
||||
|
||||
Event OnUnload()
|
||||
bAttached = false
|
||||
endEvent
|
||||
|
||||
Event OnAttachedToCell()
|
||||
bAttached = true
|
||||
endEvent
|
||||
|
||||
;/ Match OnCellDetach() for all critters, to clean up old critters [USKP 2.0.1]
|
||||
/;
|
||||
EVENT OnCellAttach()
|
||||
@ -260,6 +260,10 @@ endEVENT
|
||||
/;
|
||||
EVENT OnCellDetach()
|
||||
bAttached = false
|
||||
Cell parentCell = GetParentCell()
|
||||
if parentCell && parentCell.IsAttached()
|
||||
bAttached = true
|
||||
endif
|
||||
;~ Trace(self + "OnCellDetach() Killing self", 2)
|
||||
;! DisableAndDelete()
|
||||
; Parentcell usually removed by the time this event triggers,
|
||||
@ -1129,6 +1133,9 @@ endFunction
|
||||
/;
|
||||
Bool Function CheckCellAttached(ObjectReference AnyItemRef)
|
||||
|
||||
return bAttached && AnyItemRef
|
||||
|
||||
;/
|
||||
if ! bAttached || ! AnyItemRef
|
||||
return false
|
||||
endif
|
||||
@ -1141,6 +1148,7 @@ Bool Function CheckCellAttached(ObjectReference AnyItemRef)
|
||||
EndIf
|
||||
|
||||
Return parentCell.IsAttached()
|
||||
/;
|
||||
|
||||
EndFunction
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user