DoGrab Bug?

I'm not sure if this is a bug or simply something that needs to be added on my end but the dograb function by DC doesn't seem to work on 2d levels for some reason. It works fine on 3d levels but in 2d levels it pulls the enemy to players position but doesn't initiate the grab
 
here's the script it checks enemies position so I'm not sure what would need to be changed to better work with 2d levels

Code:
void test_dograb()
{
void self;
void target;
int d;
int x;
int y;
int z;
int xadj;

/* Get self and target. */
self = getlocalvar("self");
target = getentityproperty(self, "opponent");

/* Get position and directional values. */
d = getentityproperty(self, "direction");
x = getentityproperty(self, "x");
y = getentityproperty(self, "a");
z = getentityproperty(self, "z");
xadj = 56;

/*Reverse X adjustment if facing left. */
if(!d) xadj = -xadj;

/* Set position adjustments */
x += xadj;
z -= 1;

/* Apply position adjustment to target. */
changeentityproperty(target, "position", x, z, y);

/* Apply grab*/
dograb(self, target, 0);
}
 
here's the character's text if it helps

Code:
offset	36 199
	delay	20
	frame	data/chars/Spiderman/ws5.gif
	delay	5
	frame	data/chars/Spiderman/ws3.gif
	delay	5
	frame	data/chars/Spiderman/ws2.gif
	delay	5
	frame	data/chars/Spiderman/ws1.gif
	delay	5
	frame	data/chars/Spiderman/h1.gif
	offset	38 94
	bbox	20 40 45 60
	delay	1
	drawmethod	265 265 0 0 0 0 -1 0 0 0
	@cmd	test_dograb
	frame	data/chars/Spiderman/ga2.gif
 
Back
Top Bottom