MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / VisEffectUnlink

Function VisEffectUnlink

Descent3/viseffect.cpp:747–768  ·  view source on GitHub ↗

Unlinks a viseffect from a room Does nothing for terrain

Source from the content-addressed store, hash-verified

745// Unlinks a viseffect from a room
746// Does nothing for terrain
747void VisEffectUnlink(int visnum) {
748 vis_effect *vis = &VisEffects[visnum];
749
750 ASSERT(visnum != -1);
751
752 if (ROOMNUM_OUTSIDE(vis->roomnum))
753 return;
754 else {
755
756 room *rp = &Rooms[vis->roomnum];
757
758 if (vis->prev == -1)
759 rp->vis_effects = vis->next;
760 else
761 VisEffects[vis->prev].next = vis->next;
762
763 if (vis->next != -1)
764 VisEffects[vis->next].prev = vis->prev;
765
766 vis->roomnum = -1;
767 }
768}
769
770// when an effect has moved into a new room, this function unlinks it
771// from its old room and links it into the new room

Callers 2

VisEffectRelinkFunction · 0.85
VisEffectDeleteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected