Hanashi Posted November 4, 2016 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 113 Reputation: 40 Joined: 10/23/13 Last Seen: Friday at 03:54 PM Share Posted November 4, 2016 i tried to change void to bool on pc_getitemfromcart in pc.c and pc.h but it gives me warning on compiling if i use pc_getitemfromcart on custom @command Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted November 10, 2016 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted November 10, 2016 8 minutes ago, AshiHanna said: i only base on @dropall command This is a support topic, you should have provided the code snippets so that other members can help you check/fix the issue. Otherwise, everyone are just guessing your issue based on the outcome. On 11/7/2016 at 8:27 PM, AshiHanna said: 3>c:\users\my\desktop\ragnarok\rathena\src\map\pc.c(5162): warning C4033: 'pc_getitemfromcart' must return a value 3>c:\users\my\desktop\ragnarok\rathena\src\map\pc.c(5165): warning C4033: 'pc_getitemfromcart' must return a value 3>c:\users\my\desktop\ragnarok\rathena\src\map\pc.c(5170): warning C4033: 'pc_getitemfromcart' must return a value 3>c:\users\my\desktop\ragnarok\rathena\src\map\pc.c(5177): warning C4716: 'pc_getitemfromcart': must return a value So based on your topic, the answer would be "Add in the missing return statement/line". Quote Link to comment Share on other sites More sharing options...
0 anacondaq Posted November 5, 2016 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 1096 Reputation: 348 Joined: 02/26/12 Last Seen: May 30, 2023 Share Posted November 5, 2016 where is your warning? can you please show warning message, and function with saving lines which trigger the error. 1 Quote Link to comment Share on other sites More sharing options...
0 Hanashi Posted November 7, 2016 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 113 Reputation: 40 Joined: 10/23/13 Last Seen: Friday at 03:54 PM Author Share Posted November 7, 2016 (edited) where is your warning? can you please show warning message, and function with saving lines which trigger the error. return 0; } /*========================================== where it transfer cart items to inventory ==========================================*/ ACMD_FUNC(inventorycart) { int8 type = -1; uint16 i, count = 0, count2 = 0; struct item_data *item_data = NULL; nullpo_retr(-1, sd); if( message[0] ) { type = atoi(message); if( type != -1 && type != IT_HEALING && type != IT_USABLE && type != IT_ETC && type != IT_WEAPON && type != IT_ARMOR && type != IT_CARD && type != IT_PETEGG && type != IT_PETARMOR && type != IT_AMMO ) return -1; } if (pc_iscarton(sd) != 0) { for( i = 0; i < MAX_CART; i++ ) { if( sd->status.cart[i].amount ) { if( (item_data = itemdb_exists(sd->status.cart[i].nameid)) == NULL ) { ShowDebug("Non-existant item %d on inventoryall list (account_id: %d, char_id: %d)\n", sd->status.cart[i].nameid, sd->status.account_id, sd->status.char_id); continue; } if( type == -1 || type == (uint8)item_data->type ) { if(pc_getitemfromcart(sd, i, sd->status.cart[i].amount)) count += sd->status.cart[i].amount; else count2 += sd->status.cart[i].amount; } } } } return 0; } 3>c:\users\my\desktop\ragnarok\rathena\src\map\pc.c(5162): warning C4033: 'pc_getitemfromcart' must return a value 3>c:\users\my\desktop\ragnarok\rathena\src\map\pc.c(5165): warning C4033: 'pc_getitemfromcart' must return a value 3>c:\users\my\desktop\ragnarok\rathena\src\map\pc.c(5170): warning C4033: 'pc_getitemfromcart' must return a value 3>c:\users\my\desktop\ragnarok\rathena\src\map\pc.c(5177): warning C4716: 'pc_getitemfromcart': must return a value Edited November 7, 2016 by AshiHanna Quote Link to comment Share on other sites More sharing options...
0 anacondaq Posted November 10, 2016 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 1096 Reputation: 348 Joined: 02/26/12 Last Seen: May 30, 2023 Share Posted November 10, 2016 Your function above a little bit wrong. You trying to check with if condition that somethings has been returned from void (no return at all) function. If you will explain to me logic what do you want to get with this command, i will try to help you with this custom command. Because i'm a little bit tired and confused for now and can't understand what do you want in your function. Quote Link to comment Share on other sites More sharing options...
0 Hanashi Posted November 10, 2016 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 113 Reputation: 40 Joined: 10/23/13 Last Seen: Friday at 03:54 PM Author Share Posted November 10, 2016 @inventorycart {<item type>} transfer all items from cart to inventory based on the item type. Valid item types: -1 = All Items (default) 0 = Healing Items 2 = Useable Items 3 = Etc Items 4 = Armors 5 = Weapons 6 = Cards 7 = Pet Eggs 8 = Pet Armors 10 = Ammunition Items example: you want to transfer all healing items from cart to inventory @inventorycart 0 Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted November 10, 2016 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted November 10, 2016 show your modified code for pc_getitemfromcart you must be missing the return value part. Quote Link to comment Share on other sites More sharing options...
0 Hanashi Posted November 10, 2016 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 113 Reputation: 40 Joined: 10/23/13 Last Seen: Friday at 03:54 PM Author Share Posted November 10, 2016 i only base on @dropall command Quote Link to comment Share on other sites More sharing options...
0 Hanashi Posted November 10, 2016 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 113 Reputation: 40 Joined: 10/23/13 Last Seen: Friday at 03:54 PM Author Share Posted November 10, 2016 (edited) ok so i'll just add return 0; or return -1 in each line or something? Edited November 10, 2016 by AshiHanna Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted November 10, 2016 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted November 10, 2016 you changed to Boolean type. it should only return true / false. Quote Link to comment Share on other sites More sharing options...
0 Hanashi Posted November 10, 2016 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 113 Reputation: 40 Joined: 10/23/13 Last Seen: Friday at 03:54 PM Author Share Posted November 10, 2016 ohh got it thanks Quote Link to comment Share on other sites More sharing options...
0 anacondaq Posted November 10, 2016 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 1096 Reputation: 348 Joined: 02/26/12 Last Seen: May 30, 2023 Share Posted November 10, 2016 1 hour ago, AshiHanna said: @inventorycart {<item type>} transfer all items from cart to inventory based on the item type. Valid item types: -1 = All Items (default) 0 = Healing Items 2 = Useable Items 3 = Etc Items 4 = Armors 5 = Weapons 6 = Cards 7 = Pet Eggs 8 = Pet Armors 10 = Ammunition Items example: you want to transfer all healing items from cart to inventory @inventorycart 0 I will send here this command when it will be ready (it will take some time, don't wait for it today) Quote Link to comment Share on other sites More sharing options...
0 Hanashi Posted November 11, 2016 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 113 Reputation: 40 Joined: 10/23/13 Last Seen: Friday at 03:54 PM Author Share Posted November 11, 2016 already done lmao it has nothing to do with my custom command i just fix the boolean codes of pc_getitemfromcart Quote Link to comment Share on other sites More sharing options...
0 anacondaq Posted November 11, 2016 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 1096 Reputation: 348 Joined: 02/26/12 Last Seen: May 30, 2023 Share Posted November 11, 2016 ok then =) Quote Link to comment Share on other sites More sharing options...
Question
Hanashi
i tried to change void to bool on pc_getitemfromcart in pc.c and pc.h
but it gives me warning on compiling if i use pc_getitemfromcart on custom @command
Link to comment
Share on other sites
13 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.