mbbsemu / MBBSEmu

The MajorBBS Emulation Project is an Open Source, Cross-Platform emulator for easily running The MajorBBS & Worldgroup Modules
https://www.mbbsemu.com
MIT License
128 stars 14 forks source link

[ELWNS] Number Shuffle - Crashes on creating board (2nd step of a game) #161

Closed tuday2 closed 3 years ago

tuday2 commented 3 years ago

Module Information

Describe the bug Crashes on creating board (2nd step of a game)

To Reproduce Steps to reproduce the behavior:

  1. Add module to moduleConfig.json
  2. Start MBBSEmu
  3. Enter game and select size of grid
  4. See error

Expected behavior Able to play Number Shuffle

Screenshots

Unhandled exception. System.DivideByZeroException: Attempted to divide by zero.
   at System.Math.DivRem(Int32 a, Int32 b, Int32& result)
   at MBBSEmu.HostProcess.ExportedModules.Majorbbs.f_ldiv()
   at MBBSEmu.HostProcess.ExportedModules.Majorbbs.Invoke(UInt16 ordinal, Boolean offsetsOnly)
   at MBBSEmu.HostProcess.ExecutionUnits.ExecutionUnit.ExternalFunctionDelegate(UInt16 ordinal, UInt16 functionOrdinal)
   at MBBSEmu.HostProcess.ExecutionUnits.ExecutionUnit.Execute(IntPtr16 entryPoint, UInt16 channelNumber, Boolean simulateCallFar, Boolean bypassState, Queue`1 initialStackValues, UInt16 initialStackPointer)
   at MBBSEmu.Module.MbbsModule.Execute(IntPtr16 entryPoint, UInt16 channelNumber, Boolean simulateCallFar, Boolean bypassSetState, Queue`1 initialStackValues, UInt16 initialStackPointer)
   at MBBSEmu.HostProcess.MbbsHost.WorkerThread()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Screenshot 2020-10-04 215627-222

Software Information:

tuday2 commented 3 years ago

This is also a problem in Ringmasters when viewing top score

enusbaum commented 3 years ago

We need to add Divide By 0 checking to the Exported Ordinal F_LDIV in MAJORBBS

tuday2 commented 3 years ago

WG3 module, not compatible.