496
Curses / Re: LCS Compiling Issues
« on: August 23, 2017, 04:46:15 am »LCS contains enough code that it qualifies for the old adage that starting over might be easier than maintenance, and while it is split into multiple files, nearly all the code is contained within the same class (at least 80%) making it arguably an example of procedural programming instead of object oriented.
To give an example, the car crash teleportation bug. Some of the people who die in a car crash are potentially 'teleported' to the safehouse, meaning their dead bodies appear at home for their compatriots to deal with.
Testing to determine if the bug is fixed requires causing a car crash, but a savefile can only exist before the player even goes to a site, meaning the tester has to go to the site, antagonize its inhabitants, enter a car chase with the police, crash the car, and then check back at the safehouse to see whether the bodies were teleported.
The code dealing with car chases is 1800 lines long, and the issue was fixed by adding lines 1556 and 1599. It is possible that only one of those two additions is necessary, and it is also possible that one of those two changes causes some other problem. The car chase code is integrated into the main class and cannot be changed or tested on its own.
I once changed the code that displays combat messages, then every month congress started voting unanimously regardless of legislation, and two of the issues in the "status of the liberal agenda" were displayed in flashing red text (which only appears when an obvious error is detected). I don't know how my changes did that, so I had to revert to an earlier copy and start over. (I went line by line of the earlier copy to my new version and only included the changes I felt confident about and 4.12 was born.)
OOP would also helping with transfering most item definitions to XML files, along with making development and maintainance easier.
