]> git.pond.sub.org Git - empserver/commit
Fix flying commands for destination equal to assembly point
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 11 Aug 2012 14:46:25 +0000 (16:46 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 12 Aug 2012 07:34:49 +0000 (09:34 +0200)
commit0f1e14f0f33886f92cbfcb6c1a8b7d21a22393d9
tree928f30b6ffcd8fa586858c2980a4d8467bb40e24
parent9645a73bfb32c98dbb538577372a117678d9ffba
Fix flying commands for destination equal to assembly point

bomb, drop, fly, paradrop, recon and sweep fail when given a
destination sector equal to the assembly point.  Broken in commit
404a76f7, v4.3.27.  Reported by Tom Johnson.

Before that commit, getpath() returned NULL on error, "" when input is
an empty path, "h" when it's coordinates of the assembly point, and a
non-empty path otherwise.

The commit accidentally changed it to return "" instead of "h".

Instead of changing it back, make it return NULL when input is an
empty path, and change bomb() & friends to accept empty flight paths.

This also affects sail: it now fails when you give it an empty path,
just like bomb & friends.  Path "h" still works.
src/lib/commands/bomb.c
src/lib/commands/drop.c
src/lib/commands/fly.c
src/lib/commands/para.c
src/lib/commands/reco.c
src/lib/subs/paths.c