Pages:<< prev 1 next >>
![Post is unread](https://smaugmuds.afkmods.com/skins/default/images/icons/topic.png)
![](https://smaugmuds.afkmods.com/avatars/uploaded/52.jpg)
![This member is currently offline](https://smaugmuds.afkmods.com/skins/default/images/icons/user_offline.png)
Apprentice
![](https://smaugmuds.afkmods.com/skins/default/images/1.png)
GroupMembers
Posts86
JoinedAug 25, 2003
I'm porting AFKMUD random-treasure system from C++ to C Smaug
I notice that in AFKMUD codebase are added some specific random resets:
Z like (O)bject, "W" like (P)ut, X like (E)quip and Y like (G)ive...
But why? Isn't more simple use standard O, P, E, and G and check if the reset object is OBJ_VNUM_TREASURE ?
In this case we need just add some reset args to (O), (P), (E) and (G) for control generate_random. Same result but with more semplicity I think.
bye
matteo
I notice that in AFKMUD codebase are added some specific random resets:
Z like (O)bject, "W" like (P)ut, X like (E)quip and Y like (G)ive...
But why? Isn't more simple use standard O, P, E, and G and check if the reset object is OBJ_VNUM_TREASURE ?
In this case we need just add some reset args to (O), (P), (E) and (G) for control generate_random. Same result but with more semplicity I think.
bye
matteo
![Post is unread](https://smaugmuds.afkmods.com/skins/default/images/icons/topic.png)
![](https://smaugmuds.afkmods.com/skins/default/images/noavatar.png)
![This member is currently offline](https://smaugmuds.afkmods.com/skins/default/images/icons/user_offline.png)
Geomancer
![](https://smaugmuds.afkmods.com/skins/default/images/6.png)
GroupAdministrators
Posts1,992
JoinedJul 26, 2005
well there are different amounts of arguments for each of the new ones
![Post is unread](https://smaugmuds.afkmods.com/skins/default/images/icons/topic.png)
![](https://smaugmuds.afkmods.com/avatars/uploaded/52.jpg)
![This member is currently offline](https://smaugmuds.afkmods.com/skins/default/images/icons/user_offline.png)
Apprentice
![](https://smaugmuds.afkmods.com/skins/default/images/1.png)
GroupMembers
Posts86
JoinedAug 25, 2003
Remcon said:
well there are different amounts of arguments for each of the new ones
Yes, but imho is much better and simple add optional args to standard G, E, P, O rather than adding new W, Z, X, Y.
However I notice another thing in do_socket function:
stralloc_printf( &item->socket[0], "%s", capitalize( arg ).c_str( ) );
I don't know if it is wanted but in this case if I have a rune called "Test" and a player digits "socked tes" the socket[0] assume "Tes" name and not "Test". Isn't better use rune->name?
Bye!
![Post is unread](https://smaugmuds.afkmods.com/skins/default/images/icons/topic.png)
![](https://smaugmuds.afkmods.com/skins/default/images/noavatar.png)
![This member is currently offline](https://smaugmuds.afkmods.com/skins/default/images/icons/user_offline.png)
Geomancer
![](https://smaugmuds.afkmods.com/skins/default/images/6.png)
GroupAdministrators
Posts1,992
JoinedJul 26, 2005
I agree lol.
Pages:<< prev 1 next >>