mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2026-04-26 12:01:43 +00:00
Fixed crash in geo_remove_child()
This commit is contained in:
parent
e35402f3d1
commit
506d7dad55
1 changed files with 6 additions and 2 deletions
|
|
@ -578,12 +578,16 @@ struct GraphNode *geo_remove_child(struct GraphNode *graphNode) {
|
|||
struct GraphNode *parent;
|
||||
struct GraphNode **firstChild;
|
||||
|
||||
if (graphNode == NULL) { return NULL; }
|
||||
|
||||
parent = graphNode->parent;
|
||||
firstChild = &parent->children;
|
||||
|
||||
// Remove link with siblings
|
||||
graphNode->prev->next = graphNode->next;
|
||||
graphNode->next->prev = graphNode->prev;
|
||||
if (graphNode->prev != NULL && graphNode->next != NULL) {
|
||||
graphNode->prev->next = graphNode->next;
|
||||
graphNode->next->prev = graphNode->prev;
|
||||
}
|
||||
|
||||
// If this node was the first child, a new first child must be chosen
|
||||
if (*firstChild == graphNode) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue