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, Yahoo!, Yandex

Members: 0
Guests: 11
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 » Bugfix Lists » SWFOTE FUSS Bugfix List » [Bug] Destroyed ships are not...
Forum Rules | Mark all | Recent Posts

[Bug] Destroyed ships are not freed when desired
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Sep 10, 2006, 12:44 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Bug: Destroyed ships are not freed when desired
Danger: Trivial - The data is kept, but the ship is moved to another room to be deleted after reboot
Found by: Keberus
Fixed by: Keberus

---

space.c

Locate:
ROOM_INDEX_DATA *generate_exit( ROOM_INDEX_DATA * in_room, EXIT_DATA ** pexit );


Below that, add:
/*free up ship data by Keberus */
void free_ship( SHIP_DATA *ship )
{
   MODULE_DATA *mod, *mod_next;
   TURRET_DATA *turret, *tnext;

   STRFREE( ship->clanowner );
   STRFREE( ship->copilot );
   STRFREE( ship->description );
   STRFREE( ship->home );
   STRFREE( ship->name );
   STRFREE( ship->owner );
   STRFREE( ship->pilot );
   DISPOSE( ship->filename );
   STRFREE( ship->protoname );
   STRFREE( ship->pbeacon );
   STRFREE( ship->dest );

   /* dispose of ship module data */
   for( mod = ship->first_module; mod; mod = mod_next )
   {
      mod_next = mod->next;
      UNLINK( mod, ship->first_module, ship->last_module, next, prev );
      DISPOSE( mod );
   }

   /* dispose of ship turret data */
   for( turret = ship->first_turret; turret; turret = tnext )
   {
      tnext = turret->next;
      UNLINK( turret, ship->first_turret, ship->last_turret, next, prev );
      DISPOSE( turret );
   }
   DISPOSE( ship );
   return;
}


space.c, destroy_ship

Locate:
      sprintf( buf, "%s%s", SHIP_DIR, ship->filename );
      remove( buf );

      UNLINK( ship, first_ship, last_ship, next, prev );
      DISPOSE( ship );


Change to:
      sprintf( buf, "%s%s", SHIP_DIR, ship->filename );
      remove( buf );

      UNLINK( ship, first_ship, last_ship, next, prev );
      free_ship( ship );


Removing the ship data at the point of its destruction removes the need for the game to be rebooted somehow to get rid of the data.
       
Pages:<< prev 1 next >>