Skip to content

Commit

Permalink
Merge pull request #5 from drone1400/master
Browse files Browse the repository at this point in the history
Update dink.cpp
  • Loading branch information
SethRobinson authored Apr 14, 2023
2 parents 5841ad8 + 05126b3 commit a9d8a55
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion source/dink/dink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8897,7 +8897,14 @@ int process_line (int script, char *pLineIn, bool doelse)
int32 p[20] = {1,1,0,0,0,0,0,0,0,0};
if (get_parms(ev[1], script, h, p))
{
g_dglos.g_returnint = (rand() % g_nlist[0])+g_nlist[1];
if (g_nlist[0] == 0)
{
LogMsg("ERROR: script called random function with range set to 0! returning base value...");
g_dglos.g_returnint = g_nlist[1];
} else
{
g_dglos.g_returnint = (rand() % g_nlist[0])+g_nlist[1];
}
} else LogMsg("Failed getting parms for Random()");

strcpy_safe(pLineIn, h);
Expand Down

0 comments on commit a9d8a55

Please sign in to comment.