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)
|
DisableAndDelete(false)
|
||||||
endEvent
|
endEvent
|
||||||
|
|
||||||
Event OnLoad()
|
|
||||||
bAttached = true
|
|
||||||
endEvent
|
|
||||||
|
|
||||||
Event OnUnload()
|
Event OnUnload()
|
||||||
bAttached = false
|
bAttached = false
|
||||||
endEvent
|
endEvent
|
||||||
|
|
||||||
|
Event OnAttachedToCell()
|
||||||
|
bAttached = true
|
||||||
|
endEvent
|
||||||
|
|
||||||
;/ Match OnCellDetach() for all critters, to clean up old critters [USKP 2.0.1]
|
;/ Match OnCellDetach() for all critters, to clean up old critters [USKP 2.0.1]
|
||||||
/;
|
/;
|
||||||
EVENT OnCellAttach()
|
EVENT OnCellAttach()
|
||||||
@ -260,6 +260,10 @@ endEVENT
|
|||||||
/;
|
/;
|
||||||
EVENT OnCellDetach()
|
EVENT OnCellDetach()
|
||||||
bAttached = false
|
bAttached = false
|
||||||
|
Cell parentCell = GetParentCell()
|
||||||
|
if parentCell && parentCell.IsAttached()
|
||||||
|
bAttached = true
|
||||||
|
endif
|
||||||
;~ Trace(self + "OnCellDetach() Killing self", 2)
|
;~ Trace(self + "OnCellDetach() Killing self", 2)
|
||||||
;! DisableAndDelete()
|
;! DisableAndDelete()
|
||||||
; Parentcell usually removed by the time this event triggers,
|
; Parentcell usually removed by the time this event triggers,
|
||||||
@ -1129,6 +1133,9 @@ endFunction
|
|||||||
/;
|
/;
|
||||||
Bool Function CheckCellAttached(ObjectReference AnyItemRef)
|
Bool Function CheckCellAttached(ObjectReference AnyItemRef)
|
||||||
|
|
||||||
|
return bAttached && AnyItemRef
|
||||||
|
|
||||||
|
;/
|
||||||
if ! bAttached || ! AnyItemRef
|
if ! bAttached || ! AnyItemRef
|
||||||
return false
|
return false
|
||||||
endif
|
endif
|
||||||
@ -1141,6 +1148,7 @@ Bool Function CheckCellAttached(ObjectReference AnyItemRef)
|
|||||||
EndIf
|
EndIf
|
||||||
|
|
||||||
Return parentCell.IsAttached()
|
Return parentCell.IsAttached()
|
||||||
|
/;
|
||||||
|
|
||||||
EndFunction
|
EndFunction
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user