- [NEW] Simplificada la búsqueda de si hiha un arounder bloquejant el pas
- [FIX] Arreglat un include
This commit is contained in:
@@ -55,9 +55,6 @@ namespace arounders
|
|||||||
bool pujarEscalo(arounder *a);
|
bool pujarEscalo(arounder *a);
|
||||||
bool baixarEscalo(arounder *a);
|
bool baixarEscalo(arounder *a);
|
||||||
|
|
||||||
bool checkArounderAnt(arounder *a, int x, int y, int o);
|
|
||||||
bool checkArounderSig(arounder *a, int x, int y, int o);
|
|
||||||
|
|
||||||
void doCavar(arounder *a);
|
void doCavar(arounder *a);
|
||||||
void doPerforar(arounder *a);
|
void doPerforar(arounder *a);
|
||||||
void doEscalera(arounder *a, int desfase = 0);
|
void doEscalera(arounder *a, int desfase = 0);
|
||||||
@@ -681,11 +678,12 @@ namespace arounders
|
|||||||
|
|
||||||
bool blockArounder(arounder *a)
|
bool blockArounder(arounder *a)
|
||||||
{
|
{
|
||||||
bool resultado = false;
|
arounder *b = arounders::first;
|
||||||
if (a->anterior) resultado = checkArounderAnt(a->anterior, a->x, a->y, a->orientacio);
|
while (b) {
|
||||||
if (a->siguiente) resultado = resultado || checkArounderSig(a->siguiente, a->x, a->y, a->orientacio);
|
if ( (a != b) && ( b->accio == arounders::accions::parar ) && ( a->y >= b->y-8 ) && ( a->y <= b->y+8 ) && ( b->x == a->x+8-(a->orientacio*2) ) ) return true;
|
||||||
|
b = b->siguiente;
|
||||||
return resultado;
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool blockParet(arounder *a, int desfase)
|
bool blockParet(arounder *a, int desfase)
|
||||||
@@ -835,33 +833,6 @@ namespace arounders
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool checkArounderAnt(arounder *a, int x, int y, int o)
|
|
||||||
{
|
|
||||||
if ( a->accio == arounders::accions::parar && (y >= a->y-8) && (y <= a->y+8) && ( (o == arounders::orientacions::dreta && a->x == x+8) || (o == arounders::orientacions::esquerra && a->x == x-8) ) ) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
if (a->anterior) {
|
|
||||||
return checkArounderAnt(a->anterior, x, y, o);
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool checkArounderSig(arounder *a, int x, int y, int o)
|
|
||||||
{
|
|
||||||
if ( a->accio == arounders::accions::parar && (y >= a->y-8) && (y <= a->y+8) && ( (o == arounders::orientacions::dreta && a->x == x+8) || (o == arounders::orientacions::esquerra && a->x == x-8) ) ) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
if (a->siguiente) {
|
|
||||||
return checkArounderSig(a->siguiente, x, y, o);
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void doCavar(arounder *a)
|
void doCavar(arounder *a)
|
||||||
{
|
{
|
||||||
if (a->orientacio == arounders::orientacions::dreta) {
|
if (a->orientacio == arounders::orientacions::dreta) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "draw.h"
|
#include "draw.h"
|
||||||
#include "SDL3/SDL.h"
|
#include <SDL3/SDL.h>
|
||||||
#include "gif.h"
|
#include "gif.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include "shader.h"
|
#include "shader.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user