First of all, I'm not good at C, I know, my code is ridiculous and funny but just ignore it :)
I want to REMOVE PLR_TENNANT flag from player, ROOM_PRIVATE & ROOM_RENTED flags from his rented room, and give ROOM_RENTAL flag to his room, when he quit from game. For example, if his room(ch->pcdata->rentroom) is 3001, when he leave the mud(or disconnect) he'll lose PLR_TENNANT flag, and 3001 will be ROOM_RENTAL.
I added this code to act_comm.c (do_quit), but It didnt work:
act_comm.c:1128: hata: invalid type argument of '->' (have 'int') act_comm.c:1129: hata: invalid type argument of '->' (have 'int') act_comm.c:1130: hata: invalid type argument of '->' (have 'int')
Any ideas, suggestions, or working code? :)
PS: Sorry for my bad English.
21 Nov, 2008, David Haley wrote in the 2nd comment:
Votes: 0
What is the type of rentroom? Presumably it is ROOM_INDEX_DATA* or something like that. You need to store it into the proper data type (pointer to ROOM_INDEX_DATA) and not into an "int", which is just a number.
ch->pcdata->rentroom is a number, like 3001, it is vnum of your room. In fact, I want to use something like ch->pcdata->rentroom->room_flags, but C doesnt have an option like this.
Thanks it compiles & works now, but I have a problem:
When player runs "do_quit" command, it works, but when he just disconnects, it doesnt work. My code is under do_quit (act_comm.c). It must run this code in every disconnect&leave. Wheres the correct location for this code?
try looking around where your code handles link-dead characters and add the code in there somewhere, sorry i can't be a little more helpful, i don't know which codebase you're using nor have i fiddled around with that part of my code yet. hopefully you're at least skilled enough to find where your code handles link-dead players and then guess where the appropriate code goes.
[edit to add] oh yeah, and from what it sounds like, the do_quit function is the correct location for that code but you also need it in places where all the other forms of disconnecting are.
I want to REMOVE PLR_TENNANT flag from player, ROOM_PRIVATE & ROOM_RENTED flags from his rented room, and give ROOM_RENTAL flag to his room, when he quit from game. For example, if his room(ch->pcdata->rentroom) is 3001, when he leave the mud(or disconnect) he'll lose PLR_TENNANT flag, and 3001 will be ROOM_RENTAL.
I added this code to act_comm.c (do_quit), but It didnt work:
Here's the compiler output:
Any ideas, suggestions, or working code? :)
PS: Sorry for my bad English.