Login
User Name:

Password:



Register

Forgot your password?
IPv6
Jan 25, 2025 10:45 pm
By Samson
mudstrlcpy and mudstrlcat
Jan 18, 2025 5:23 pm
By Samson
I3 and IMC
Jan 17, 2025 9:35 pm
By Samson
AFKMud 2.5.1
Jan 17, 2025 2:22 pm
By Samson
Array out of bounds ?
Jan 16, 2025 4:48 am
By Remcon
SmaugFUSS 1.9.7
Author: Various
Submitted by: Samson
AFKMud 2.5.1
Author: AFKMud Team
Submitted by: Samson
Kayle's Weather Code for AFKMud
Author: Kayle
Submitted by: Samson
AFKMud 2.5.0
Author: AFKMud Team
Submitted by: Samson
SWFotEFUSS 1.5.2
Author: Various
Submitted by: Samson
Users Online
Anthropic, AhrefsBot, GPTBot, Bing, Naver

Members: 0
Guests: 10
Stats
Files
Topics
Posts
Members
Newest Member
503
3,811
19,714
589
xhuul

» SmaugMuds » Codebases » SWFOTE FUSS » Ship Crashing into objects..
Forum Rules | Mark all | Recent Posts

Ship Crashing into objects..
< Newer Topic :: Older Topic > Crashing into the sun for mainly..

Pages:<< prev 1 next >>
Post is unread #1 Mar 29, 2024 7:48 am   
Go to the top of the page
Go to the bottom of the page

Elwood
Fledgling
GroupMembers
Posts11
JoinedMar 29, 2024

 
Hey again. It's been years, got back into playing with this stuff. Be more learning to do lol.
I used to be Deathbringer/RapidRunner but i dont know password i used, or have the email i used years ago..
anyhow... problem is...

You fly any ship into the sun it'll crash mud.

Speed: 100 Hull: 100% Shields: 0% Energy: 96%
Coordinates in Coruscant system: 110 -122 121
Proximity alert: Corusca Prime 0 0 0


Core Dump:

0x0000558e29710152 in move_ships () at space.c:606
606 if( !ship || !ship->starsystem )
(gdb) bt
#0 0x0000558e29710152 in move_ships () at space.c:606
#1 0x0000558e297758dc in update_handler () at update.c:2663
#2 0x0000558e2961bce6 in game_loop () at comm.c:570
#3 0x0000558e2961ab3b in main (argc=2, argv=0x7ffd9991c308) at comm.c:246


Post is unread #2 Mar 29, 2024 5:45 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,992
JoinedJul 26, 2005

 
well after a quick look at the code you probably should add a ship_next and set ship_next to ship->next at the start and use ship_next instead of ship->next in the for loop. the ship is being destroyed when it flies into the sun and causing the issue.

Post is unread #3 Mar 30, 2024 12:54 am   Last edited Mar 30, 2024 5:38 am by Elwood
Go to the top of the page
Go to the bottom of the page

Elwood
Fledgling
GroupMembers
Posts11
JoinedMar 29, 2024

 
Remcon is a Genius! Don't know why i didnt think of it! lol.

Fix that works then would be here to help others.

in space.c move_ship
find
SHIP_DATA *ship;

and change it to:
SHIP_DATA *ship, *ship_next;


find
for ( ship = first_ship; ship; ship = ship->next )
   {


change it to:
for (ship = first_ship; ship; ship = ship_next)
{
    // Store the next ship pointer before potentially destroying the current ship
    ship_next = ship->next;


its what i did and its working

Pages:<< prev 1 next >>