diff options
author | rodri <rgl@antares-labs.eu> | 2023-05-05 22:35:14 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2023-05-05 22:35:14 +0000 |
commit | d2c0ab7a62b7a2c99c4c491ce55466859429571b (patch) | |
tree | 5010f2e6b2e3a87486a7f65dd73f40eee7fec04c /party.c | |
parent | f959555dc653ecf54d75b180fcd018075e652e93 (diff) | |
download | musw-d2c0ab7a62b7a2c99c4c491ce55466859429571b.tar.gz musw-d2c0ab7a62b7a2c99c4c491ce55466859429571b.tar.bz2 musw-d2c0ab7a62b7a2c99c4c491ce55466859429571b.zip |
handle player quits gracefully.
also fixed a bug whereby a player would never be freed if no party was happening, and another one where deleting a player from the player queue would cause a nil pointer deref.
Diffstat (limited to 'party.c')
-rw-r--r-- | party.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -117,7 +117,7 @@ playerq_del(Playerq *pq, Player *p) return; } - for(np = pq->head; np->next != nil; np = np->next) + for(np = pq->head; np != nil && np->next != nil; np = np->next) if(np->next == p){ np->next = np->next->next; p->next = nil; |