~melchizedek6809/WolkenWelten

18b6752d7622664f291c5b14f2c3dde2fb244a59 — Ben (X13/Arch) 16 days ago 2bd3a79
Made hitChecks more reliable.

Also less performant, but reliability is more
important.
2 files changed, 4 insertions(+), 5 deletions(-)

M common/src/game/animal.c
M common/src/game/being.c
M common/src/game/animal.c => common/src/game/animal.c +1 -3
@@ 358,13 358,11 @@ animal *animalClosest(const vec pos, float maxDistance){
}

static void animalUpdateBL(){
	static uint calls = 0;
	for(uint i=calls&0x1F;i<animalCount;i+=0x20){
	for(uint i=0;i<animalCount;i++){
		if(animalList[i].type == 0){continue;}
		animal *a = &animalList[i];
		a->bl = beingListUpdate(a->bl,animalGetBeing(a));
	}
	calls++;
}

void animalUpdateAll(){

M common/src/game/being.c => common/src/game/being.c +3 -2
@@ 442,8 442,9 @@ beingList *beingListUpdate(beingList *bl, being entry){
	if(entry == 0){return NULL;}
	vec pos = beingGetPos(entry);
	beingList *nbl = beingListGet(pos.x,pos.y,pos.z);
	if(bl == nbl){return bl;}
	beingListDel( bl,entry);
	if(bl != nbl){
		beingListDel( bl,entry);
	}
	beingListAdd(nbl,entry);
	return nbl;
}