From 35dbeea702900a5f28ee127cbfcf0a115f8f14cc Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 7 Mar 2020 04:37:24 +0100 Subject: [PATCH] fixed ambush size --- complex2.cpp | 6 ++---- items.cpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/complex2.cpp b/complex2.cpp index ac69929d..ed89abdf 100644 --- a/complex2.cpp +++ b/complex2.cpp @@ -798,8 +798,8 @@ EX int size(cell *c, eItem what) { } -EX void ambush(cell *c, eItem what) { - LATE ( ambush(c, what); ) +EX void ambush(cell *c, int dogs) { + LATE ( ambush(c, dogs); ) int maxdist = gamerange(); celllister cl(c, maxdist, 1000000, NULL); cell *c0 = c; @@ -812,7 +812,6 @@ EX void ambush(cell *c, eItem what) { if(dh > d) c0 = cx, d = dh; } if(sphere) { - int dogs = size(c, what); for(int i = cl.lst.size()-1; i>0 && dogs; i--) if(!isPlayerOn(cl.lst[i]) && !cl.lst[i]->monst) cl.lst[i]->monst = moHunterDog, dogs--; @@ -849,7 +848,6 @@ EX void ambush(cell *c, eItem what) { } } int N = isize(around); - int dogs = size(c, what); int gaps = dogs; int result = dogs0; diff --git a/items.cpp b/items.cpp index 64d68278..4699a3fa 100644 --- a/items.cpp +++ b/items.cpp @@ -80,7 +80,7 @@ EX bool collectItem(cell *c2, bool telekinesis IS(false)) { } if(c2->land == laHunting && c2->item && !inv::activating) { - ambush::ambush(c2, c2->item); + ambush::ambush(c2, ambush::size(c2, c2->item)); } if(isRevivalOrb(c2->item) && multi::revive_queue.size()) {