Readied spell can be swapped to something else in between the cast and the hit frame, resulting in incorrect removal.
This is how currently belt scrolls are checked so we are now using a consistent strategy.
Identified and removed an instance of Direction being used as an argument for a bool parameter
Removed a single-use temporary variable being cast from sprite frame to direction to size_t
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
Fix alignment of WalkSettings array
In cases like path_get_h_cost this allows simplifying logic where Point provides functions for the intended behaviour in a much simpler to understand package.
This also makes it clearer which functions are const/don't modify the node and which potentially have side effects.
Only path_solid_pieces and FindPath are used outside the file, but the other functions are exposed in the header and have behaviour I felt worth testing individually.
* Update random number functions to avoid IB
Most calls to set seed were using uint32_t already, there were a few variables which were better served by having their type changed from signed to unsigned. The one exception is ItemStruct::_iSeed. This is an identifier that also happens to be used as a seed occasionally so a comment was added documenting this exception.
Includes suggested style changes for Source/towners.h; Source/towners.cpp; Source/msg.h; Source/multi.h
Hoping to add a few tests for normal operation as a sanity check. The eventual goal is to be able to split the distribution functions from the engine so they can be tested and implemented independently.
This is recommended for GTest and is a requirement to use FRIEND_TEST (see http://google.github.io/googletest/reference/testing.html#FRIEND_TEST). If the random number generator code becomes a class with private attributes this allows us to switch to test fixtures more easily.
Use Point wherever possible
Make some functions static (not exhaustive)
Reduce excessive indentation (not exhaustive)
Declare variables as needed (not exhaustive)
This documents the chosen LCG parameters and the default mapping function used in random number generation.
GetLCGEngineState() is a helper needed for testing because AdvanceRndSeed combines a distribution with a call to progress the engine. I'll split those eventually but this at least shows the current behaviour and should flag any bugs introduced by future changes.