Thread Rating:
  • 5 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[QOL] [Feature] State AI Laws (Advanced)
#5
kurt found a bug where if you type "1;1;1" in, you get really odd results.

I've commit a fix to the pull request, but the fix is to add the following code:

Code:
// 1;1;1 becomes 1:list() and 1=2;1=3 becomes 1:(2,3), so we need to break the results down into one association per index
    
    var/found = 0
    for (var/index in laws_to_state)
        if(laws_to_state[index])
            for (var/association in laws_to_state[index])
                if(association)
                    laws_to_state[index] = association
                    found = 1
                    break
                    
            if(!found)
                laws_to_state[index] = null
                
            found = 0

after

Code:
laws_to_state = params2list(state)
Reply


Messages In This Thread
RE: [QOL] [Feature] State AI Laws (Advanced) - by UrsulaMejor - 09-02-2019, 08:44 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)