4
Fork 0

Improved critter.psc fix

development
Eddoursul 3 months ago
parent 5401437976
commit d0512f2177
  1. BIN
      scripts/critter.pex
  2. 16
      source/scripts/critter.psc

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…
Cancel
Save