[patch] reduce size of warenbauer_t::max_catg_index December 08, 2008, 09:40:58 pm This patch will reduce the size of warenbauer_t::max_catg_index. The decrease depends on the used pakset (for both pak/ and pak.german/ it's 3). Now warenbauer_t::load_nichts gets no catg_index, I think it will never be used (who will transport nothing?) - but I don't overlooking the whole code.As a result this code will save some memory in haltestelle_t. Quote Selected
Re: [patch] reduce size of warenbauer_t::max_catg_index Reply #1 – December 08, 2008, 10:13:38 pm Many engines transport nothing, as well as tenders ... Quote Selected
Re: [patch] reduce size of warenbauer_t::max_catg_index Reply #2 – December 08, 2008, 10:27:47 pm Yes, but do they need the catg_index of nichts?Edit:An other suggestion: Is it possible to set the pointer of vehicles, wich can't transport something, to NULL? Then there is no longer a need for warenbauer_t::nichts. Quote Selected Last Edit: December 08, 2008, 10:32:55 pm by gerw
Re: [patch] reduce size of warenbauer_t::max_catg_index Reply #3 – December 09, 2008, 09:30:09 pm Yes, everything is possible. For connections a connection for nothing is not needed anyway. But I think somewhere indexes where hardcodes to 0, 1, and 2. Quote Selected
Re: [patch] reduce size of warenbauer_t::max_catg_index Reply #4 – December 10, 2008, 09:03:50 am Quote from: prissi – on December 09, 2008, 09:30:09 pmBut I think somewhere indexes where hardcodes to 0, 1, and 2.But this is not very OOP Edit:You can neglect the changes of lines 61,63 and 67. Then load_nichts.catg_index is 2 and everything is fine. Quote Selected Last Edit: December 10, 2008, 09:14:53 am by gerw
Re: [patch] reduce size of warenbauer_t::max_catg_index Reply #5 – December 10, 2008, 07:46:39 pm Nothing against clean up the code and remove those hardcoded entries ... (if I have not done this already, I am getting old ... ) Quote Selected