MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / zFrag_LightningManager

Function zFrag_LightningManager

src/SB/Game/zShrapnel.cpp:768–815  ·  view source on GitHub ↗

equivalent

Source from the content-addressed store, hash-verified

766
767// equivalent
768void zFrag_LightningManager(F32 dt)
769{
770 xVec3 start;
771 xVec3 end;
772 zFrag* frag = sLightningList.next;
773
774 while (frag != NULL)
775 {
776 zFrag* next = frag->next;
777 zLightning* inst = frag->info.lightning.lightning;
778 zFragLightningAsset* lasset = frag->info.lightning.fasset;
779
780 frag->lifetime -= dt;
781 frag->alivetime += dt;
782
783 if (frag->lifetime < 0.0f)
784 {
785 zLightningKill(inst);
786 zFrag_Free(frag);
787 }
788 else
789 {
790 if ((lasset->start.type & eFragLocBoneUpdated) != 0 ||
791 (lasset->end.type & eFragLocBoneUpdated) != 0)
792 {
793 if ((lasset->start.type & eFragLocBoneUpdated) != 0)
794 {
795 zFragLoc_InitVec(&lasset->start, &start, frag->parent[0]);
796 }
797 else
798 {
799 xVec3Copy(&start, (xVec3*)((U8*)inst + 0x8));
800 }
801
802 if ((lasset->end.type & eFragLocBoneUpdated) != 0)
803 {
804 zFragLoc_InitVec(&lasset->end, &end, frag->parent[1]);
805 }
806 else
807 {
808 xVec3Copy(&end, (xVec3*)((U8*)inst + 0x14));
809 }
810 zLightningModifyEndpoints(inst, &start, &end);
811 }
812 }
813 frag = next;
814 }
815}
816
817void zFrag_DefaultSoundUpdate(zFrag* frag, F32 param_2)
818{

Callers 1

zShrapnel_UpdateFunction · 0.70

Calls 5

zLightningKillFunction · 0.85
zFrag_FreeFunction · 0.85
zFragLoc_InitVecFunction · 0.85
xVec3CopyFunction · 0.85

Tested by

no test coverage detected