Make loop end point thing sorting consistent (fixes loop desyncs)
This commit is contained in:
parent
099bdb1be0
commit
448495c91c
1 changed files with 6 additions and 2 deletions
|
|
@ -757,9 +757,13 @@ static int cmp_loopends(const void *a, const void *b)
|
||||||
*mt2 = *(const mapthing_t*const*)b;
|
*mt2 = *(const mapthing_t*const*)b;
|
||||||
|
|
||||||
// weighted sorting; tag takes precedence over type
|
// weighted sorting; tag takes precedence over type
|
||||||
return
|
const int maincomp = intsign(mt1->tid - mt2->tid) * 2 +
|
||||||
intsign(mt1->tid - mt2->tid) * 2 +
|
|
||||||
intsign(mt1->args[0] - mt2->args[0]);
|
intsign(mt1->args[0] - mt2->args[0]);
|
||||||
|
|
||||||
|
// JugadorXEI (04/20/25): If a qsort comparison ends up with an equal result,
|
||||||
|
// it results in UNSPECIFIED BEHAVIOR, so assuming the previous two comparisons
|
||||||
|
// are equal, let's make it consistent with Linux behaviour (ascending order).
|
||||||
|
return maincomp != 0 ? maincomp : intsign((mt1 - mapthings) - (mt2 - mapthings));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void P_SpawnMapThings(boolean spawnemblems)
|
static void P_SpawnMapThings(boolean spawnemblems)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue