I tried using this function, but it looks like it checks for all textures available...
Code: Select all
action void W_useFilter() {
int SectorNumber;
let pawn = wastelandRanger(self);
for (SectorNumber = 0; SectorNumber < level.sectors.size(); SectorNumber++) {
if (level.sectors[SectorNumber].damageamount > 0) {
textureid foo = level.sectors[SectorNumber].GetTexture(sector.floor);
string floorTexture = TexMan.GetName(foo);
A_Log(floorTexture);
if (floorTexture == "F_WTRA1" || floorTexture == "F_WTRA2" || floorTexture == "F_WTRA3" || floorTexture == "F_WTRA4") {
pawn.GiveInventory("foodCistaVoda", 1);
pawn.A_Log("\c[green][ Filtered some water! ]");
break;
} else {
pawn.A_Log("\c[green][ You must stand in water in order to use water filter!] ");
}
}
}
}