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

Function aDestroyAllRobotsEnd

scripts/DallasFuncs.cpp:4653–4687  ·  view source on GitHub ↗

$$ACTION Objects Destroy All Robots: End aDestroyAllRobotsEnd Destroys the robots (except those spared) in the level $$END */

Source from the content-addressed store, hash-verified

4651$$END
4652*/
4653void aDestroyAllRobotsEnd(void) {
4654 tKillRobotListNode *curr = KillRobotList.list;
4655 int count = 0;
4656
4657 if (!curr)
4658 return;
4659
4660 while (curr) {
4661 count++;
4662 curr = curr->next;
4663 }
4664
4665 curr = KillRobotList.list;
4666 tKillObjectItem *kolist = NULL;
4667
4668 kolist = (tKillObjectItem *)malloc(sizeof(tKillObjectItem) * count);
4669 if (!kolist)
4670 return;
4671
4672 count = 0;
4673 while (curr) {
4674 memcpy(&kolist[count], &curr->item, sizeof(tKillObjectItem));
4675 count++;
4676 curr = curr->next;
4677 }
4678
4679 msafe_struct ms;
4680 ms.count = count;
4681 ms.list = kolist;
4682 MSafe_CallFunction(MSAFE_OBJECT_DESTROY_ROBOTS_EXCEPT, &ms);
4683
4684 free(kolist);
4685
4686 KillRobotList.clear();
4687}
4688
4689/*
4690$$ACTION

Callers 3

DoFrameMethod · 0.85
SetModeMethod · 0.85
CallEventMethod · 0.85

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected