Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 parse description bug
Yesterday, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, DotBot

Members: 0
Guests: 9
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWR FUSS » do_trajectory - ATOF "inf"
Forum Rules | Mark all | Recent Posts

do_trajectory - ATOF "inf"
< Newer Topic :: Older Topic > SWR Space code - ATOF("inf")

Pages:<< prev 1 next >>
Post is unread #1 Jan 29, 2008, 12:37 pm
Go to the top of the page
Go to the bottom of the page

Darrik
Fledgling
GroupMembers
Posts20
JoinedJan 29, 2008

Greetings,

A bug was recently pointed out to me in stock SWR space code ( and in SWRIP's ). If a player types "course inf inf inf" it will actually set the ship's heading to 'inf inf inf.' Apparently, atof("inf") returns infinity. This will lead to the ship having a position of nan the next time it's position updates.

I fixed it with this:

if ( ship->hx == atof("inf") )
ship->hx = 0;
if ( ship->hy == atof("inf") )
ship->hy = 0;
if ( ship->hz == atof("inf") )
ship->hz = 0;

Put just before the line:

change = sqrt (ship->hx * ship->hx + ship->hy * ship->hy + ship->hz * ship->hz);

which is line 409 in stock SWR 1.0.

I started by checking for it in do_trajectory, but decided I'd catch any situation if I put it here.

Darrik Vequir
       
Post is unread #2 Jan 29, 2008, 12:39 pm
Go to the top of the page
Go to the bottom of the page

Darrik
Fledgling
GroupMembers
Posts20
JoinedJan 29, 2008


Then again, there is a topic for this already below. Please delete.
       
Pages:<< prev 1 next >>