keeperfx icon indicating copy to clipboard operation
keeperfx copied to clipboard

rewrite Get human controlled creature target

Open PieterVdc opened this issue 1 year ago • 7 comments

selects what target is hit when hitting in posession

also refactored some eye_height related stuff

PieterVdc avatar Jul 15 '22 14:07 PieterVdc

hmm pseudo code says pos, but I've seen cases where pseudo code is simply wrong so I tried num but makes no difference, also found and fixed another mistake but still always returns 0

PieterVdc avatar Aug 12 '22 18:08 PieterVdc

hmm pseudo code says pos, but I've seen cases where pseudo code is simply wrong so I tried num but makes no difference, also found and fixed another mistake but still always returns 0

Well, MapSubtlCoord is a subtile number, which is num. Have you tried using MapCoord and val?

AdamPlenty avatar Aug 12 '22 18:08 AdamPlenty

also checked val yes, but since it has the >256 check under it it's clearly not val

PieterVdc avatar Aug 12 '22 18:08 PieterVdc

also checked val yes, but since it has the >256 check under it it's clearly not val

That looks like a subtile number to me.

AdamPlenty avatar Aug 12 '22 18:08 AdamPlenty

yeah I believe it's num as well, but it's not the only bug I guess

PieterVdc avatar Aug 12 '22 18:08 PieterVdc

if you wanne have a go at it feel free to commit to this branch

PieterVdc avatar Aug 12 '22 18:08 PieterVdc

I can't figure out why this doesn't work either :(. I do know, however, that the for (i = thing_get(get_mapwho_thing_index(mapblk)); !thing_is_invalid(i); i = thing_get(i->next_on_mapblk)) always returns an invalid thing, so I'm guessing it's looking at the wrong co-ordinates.

Edit: I tried resetting the x co-ordinate after the x loop, but it still doesn't work.

It seems to be working now, touch wood; I made a few silly errors in my code.

AdamPlenty avatar Aug 12 '22 21:08 AdamPlenty