Skip to content

Commit

Permalink
Drag spellbooks backwards, moved things drag positions (#1491)
Browse files Browse the repository at this point in the history
- Stopped imps from moonwalking while dragging
- Stopped imps from teleporting books
- Made drag positions of all things to be behind the imp instead of inside the imp
  • Loading branch information
Loobinex committed May 26, 2022
1 parent 5e978b1 commit c473276
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/creature_states_spdig.c
Expand Up @@ -1504,7 +1504,7 @@ short creature_picks_up_spell_object(struct Thing *creatng)
// Create event to inform player about the spell or special (need to be done before pickup due to ownership changes)
update_library_object_pickup_event(creatng, picktng);
creature_drag_object(creatng, picktng);
if (!setup_person_move_to_coord(creatng, &pos, NavRtF_Default))
if (!setup_person_move_backwards_to_coord(creatng, &pos, NavRtF_Default))
{
SYNCDBG(8,"Cannot move to (%d,%d)",(int)pos.x.stl.num, (int)pos.y.stl.num);
set_start_state(creatng);
Expand Down
10 changes: 9 additions & 1 deletion src/thing_creature.c
Expand Up @@ -5190,7 +5190,15 @@ TngUpdateRet update_creature(struct Thing *thing)
{
struct Thing* tngp = thing_get(cctrl->dragtng_idx);
if ((tngp->state_flags & TF1_IsDragged1) != 0)
move_thing_in_map(tngp, &thing->mappos);
{
struct Coord3d* tngpos = &thing->mappos;
struct Coord3d pvpos;
pvpos.x.val = tngpos->x.val - (2 * thing->velocity.x.val);
pvpos.y.val = tngpos->y.val - (2 * thing->velocity.y.val);
pvpos.z.val = tngpos->z.val;

move_thing_in_map(tngp, &pvpos);
}
}
if (update_creature_levels(thing) == -1)
{
Expand Down

0 comments on commit c473276

Please sign in to comment.