Merge branch 'paxed-new_lev_comp' of https://rodney.nethack.org:20040/git/NHsource into paxed-new_lev_comp

Conflicts:
	include/obj.h
	include/patchlevel.h
	src/topten.c
	src/trap.c
	sys/winnt/Makefile.msc
This commit is contained in:
Pasi Kallinen
2015-03-24 19:59:40 +02:00
13 changed files with 8508 additions and 3334 deletions

View File

@@ -3452,20 +3452,21 @@ line_dist_coord(x1,y1, x2,y2, x3,y3)
{
long px = x2-x1;
long py = y2-y1;
long s = px*px + py*py;
long x, y, dx, dy, dist = 0;
float u = 0;
if (x1 == x2 && y1 == y2) return isqrt(dist2(x1,y1, x3,y3));
long s = px*px + py*py;
float u = ((x3 - x1) * px + (y3 - y1) * py) / (float)s;
u = ((x3 - x1) * px + (y3 - y1) * py) / (float)s;
if (u > 1) u = 1;
else if (u < 0) u = 0;
long x = x1 + u * px;
long y = y1 + u * py;
long dx = x - x3;
long dy = y - y3;
long dist = isqrt(dx*dx + dy*dy);
x = x1 + u * px;
y = y1 + u * py;
dx = x - x3;
dy = y - y3;
dist = isqrt(dx*dx + dy*dy);
return dist;
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 topten.c $NHDT-Date: 1426731079 2015/03/19 02:11:19 $ $NHDT-Branch: harder_d8 $:$NHDT-Revision: 1.25 $ */
/* NetHack 3.5 topten.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 topten.c $Date: 2012/01/24 04:26:15 $ $Revision: 1.23 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 trap.c $NHDT-Date: 1426805491 2015/03/19 22:51:31 $ $NHDT-Branch: water_damage $:$NHDT-Revision: 1.198 $ */
/* NetHack 3.5 trap.c $NHDT-Date: 1426558928 2015/03/17 02:22:08 $ $NHDT-Branch: master $:$NHDT-Revision: 1.195 $ */
/* NetHack 3.5 trap.c $Date: 2013/03/14 01:58:21 $ $Revision: 1.179 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */