#exult@irc.freenode.net logs for 17 Nov 2014 (GMT)

Archive Today Yesterday Tomorrow
Exult homepage


[00:02:44] <wjp> you're overcomplicating things :-)
[00:03:14] <wjp> items_in_hand is the number of items the NPC is already holding
[00:03:22] <wjp> nearby is the number of items nearby
[00:03:44] <wjp> (7 + rand()%5) is how many items it (thinks it) wants
[00:03:54] <wjp> so nitems is the number of new items to create
[00:04:26] <wjp> if nitems is positive, it increments items_in_hand by that amount, and adds nitems new items in that loop
[00:05:01] <wjp> so if you want at most one item to be created, you can just do nitems = 1 - items_in_hand - nearby; (instead of the current line)
[00:09:47] <wjp> does that explain things? It's about bedtime for me, so I'll be leaving soon
[00:15:49] <wjp> (oh, and to answer your actual question: adding that check to the first if, just makes it add items when it has none. But it will still create 7 to 12 of them)
[02:41:22] --> DominusExult has joined #exult
[02:41:24] --- ChanServ gives channel operator status to DominusExult
[02:43:00] <-- Dominus has left IRC (Ping timeout: 240 seconds)
[02:43:02] --- DominusExult is now known as Dominus
[06:27:57] <-- Lightkey has left IRC (Ping timeout: 272 seconds)
[06:40:05] --> Lightkey has joined #exult
[07:38:01] <Dominus> thanks wjp, understand now
[07:38:21] <Dominus> http://pastie.org/9724546 <- too much comment?+
[08:24:47] --> vimus has joined #exult
[09:35:40] <wjp> nah, is fine
[10:56:16] <Dominus> ok, done for now
[10:58:00] <Dominus> thanks for the much needed help :=
[10:58:02] <Dominus> :)
[11:01:36] <wjp> no problem; thanks for investigating
[13:19:45] --> TheCycoONE has joined #exult
[14:05:14] <-- Lightkey has left IRC (Ping timeout: 272 seconds)
[14:17:41] --> Lightkey has joined #exult
[14:53:17] <-- sh4rm4 has left IRC (Remote host closed the connection)
[14:55:01] --> sh4rm4 has joined #exult
[15:05:22] --> TimQuester has joined #exult
[17:23:09] <-- vimus has left IRC ()
[18:20:25] <-- TimQuester has left IRC (Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/)
[18:36:21] --- amatecha_ is now known as amatecha
[22:10:29] <-- TheCycoONE has left IRC (Quit: And then there were n-1)
[23:48:04] --> Lothlann has joined #exult