diff options
Diffstat (limited to 'TODO.md')
| -rw-r--r-- | TODO.md | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -1,6 +1,4 @@ ## TODO NEXT -- CRNONPL.CC <- GAME -- MOVEUSE.CC <- GAME - HOUSES.CC <- GAME - QUERY.CC - READER.CC @@ -13,11 +11,19 @@ `ObjectType` to be used as an alias when pertinent. - Make some `TNonplayer` random step function? One version that does a random step and another that does a random step keeping some distance from a certain position. +- I realized that `Change` with an `ObjectType` parameter was being called where + the version with `INSTANCEATTRIBUTE` parameter was expected due to `ObjectType` + having an implicit conversion constructor from `int`. I think it is best to make + all converting constructors explicit to avoid these types of errors, although + there aren't that many function overloads. + +- Define a few constants like `MAX_NAME_LENGTH`, `MAX_SKILLS`, and `MAX_OPEN_CONTAINERS` instead of relying on `NARRAY`. + ## Stack allocations Any functions that use `alloca` or some other form of dynamic stack allocations will cause decompiled functions to be an absolute mess. It usually shows up in the decompiled code as both a size computation like `-(VAR + CONST & 0xfffffff0)`, followed by some assignment. It doesn't make total sense without looking at the disassembly. I've encountered ~30 such computations and expect the functions containing them to be amongt the most challenging/annoying to be properly decompiled. ## Exceptions -I didn't dive into how exceptions are handled, but it seems that the ones related to creature actions have the outter most endpoint at `TCreature::Execute`. There can also be some checkpoints in between to modify a `RESULT` value or handle a failure. +It's absolute hell. ## Synchronization I'm not sure whether synchronization is done properly. The implementation of the first few `crplayer.cc` functions left me with a taste of race conditions although integer loads on x86 are generally atomic. @@ -31,6 +37,8 @@ We'll have to address this BEFORE trying to run the server. The decompiled file has ~115K lines of C. If we take ~15K lines to be rubbish, this can be round to ~100K. Considering a low estimate of 200 lines per day, the whole process could take up to 500 days which is quite a bit but not impossible. Now considering a high estimate of 1K lines per day, it could take 100 days which is also quite a bit. ## TODO AFTER FIRST PASS +- Remove VTABLE comments. +- Split NPC, Monster, and Player into separate header files. - Review dividing comments. I feel like the current "//========" blends in too easily, making it hard to see. - Trim rough edges. - Replace unsafe libc functions like `strcpy`, `strncpy`, `strcat`, `sprintf` etc... |
