[Ohrrpgce] SVN: james/8927 add hero_collision_check functions similar to the npc_collision_check fu

Ralph Versteegen teeemcee at gmail.com
Sat Jul 1 00:33:52 PDT 2017


On 1 July 2017 at 10:09, <subversion at hamsterrepublic.com> wrote:

> james
> 2017-06-30 15:09:36 -0700 (Fri, 30 Jun 2017)
> 110
> add hero_collision_check functions similar to the npc_collision_check
> functions
> use them for hero pathfinding
> ---
> U   wip/game.bas
> U   wip/game.bi
> U   wip/pathfinding.bas
> U   wip/pathfinding.bi
>

Hmm, quite a bit of duplicated code! It would be tricky to share code, but
I think it's doable. Were you planning/working on that?
After quite a lot of inspection I found they already don't agree: I see
hero_collision_check won't work correctly if you're in a vehicle, or if
walk-through-walls is enabled. And keeping them in agreement will be a
nuisance.

The "movdivis" checks can be moved from want_to_check_for_walls to
update_heroes, so that that function can be called from hero_collision_check
The vehicle_is_animating() = NO checks, NPC pushing and NPC activation can
be moved out of the collision block in update_heroes, so that that block
can replaced with a call to hero_collision_check.
The fact that hero_collision_check stops when it finds a wall collision but
update_heroes doesn't, doesn't matter because a wall collision sets x/ygo
to 0 so that an NPC collision/activation can't happen except in the corner
case that you're standing on top of a touch-activated NPC.

Also, pixelpos is unused.

I guess we'll need to special case pushing an NPC when using the mouse.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20170701/566c18bf/attachment.htm>


More information about the Ohrrpgce mailing list