From 37f4e400bdc7d8acc0d0cc03c418f23ec43e6e34 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 21 May 2022 13:09:46 +0200 Subject: [PATCH] made all_disk_cells and all_disk_cells_sorted different, for consistency --- cell.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cell.cpp b/cell.cpp index 1d720429..6b5ce6dc 100644 --- a/cell.cpp +++ b/cell.cpp @@ -333,19 +333,22 @@ EX hookset hooks_newmap; EX int req_disksize, disksize; EX vector all_disk_cells; +EX vector all_disk_cells_sorted; EX void init_disk_cells() { disksize = req_disksize; all_disk_cells.clear(); + all_disk_cells_sorted.clear(); if(!disksize) return; celllister cl(currentmap->gamestart(), 1000000, disksize, NULL); all_disk_cells = cl.lst; - sort(all_disk_cells.begin(), all_disk_cells.end()); + all_disk_cells_sorted = cl.lst; + sort(all_disk_cells_sorted.begin(), all_disk_cells_sorted.end()); } EX bool is_in_disk(cell *c) { - auto it = lower_bound(all_disk_cells.begin(), all_disk_cells.end(), c); - if(it == all_disk_cells.end()) return false; + auto it = lower_bound(all_disk_cells_sorted.begin(), all_disk_cells_sorted.end(), c); + if(it == all_disk_cells_sorted.end()) return false; return *it == c; }