Code: Select all
function bool pos_havesector(fixed X,fixed Y){
bool out=false;
if(SOMETHING TO MAKE MAGIC HAPPEN) out=true;
return out;
}
a the map is a cube of 64x64, the position X:0 Y:0 is on the middle of this cube, so if I call pos_havesector(0,0) it would return 1, but if I call pos_havesector(100.0,100.0) it would return 0.
and yes, I tried to make it, this is the best that I did, but it's giving wrong information =/
Code: Select all
function bool pos_havesector(int float_x, int float_y){
bool out=false;
int tid=unusedTID(1000,2000);//receive a tid not used ingame
int floor=GetSectorFloorZ(0,float_x,float_y);
int ceiling=GetSectorCeilingZ(0,float_x,float_y);
print(s:"floor:",f:floor,s:" ceiling:",f:ceiling);
if(floor<ceiling){
spawn("mapspot",float_x,float_y,floor,tid,0);
if(thingcount(t_none,tid))out=true;
}return out;
}