• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[solved]

Status
Not open for further replies.

IonS

Master Blaster Noob
Joined
May 14, 2008
Messages
191
Reaction score
0
Location
Brazil
Closed!
[SOLVED]

 
Last edited:
1- Why would you want to change it?
2- Change the variable type ;s, i bet is uint32_t.
but in which file? what's the variabels that I must to change?
I've tryied it, but i don't know if I've changed all teh variables needed..
 
I guess items.cpp and maybe items.h? im not checking it, im lazy, sry.

4294967295 (max value of uint32_t, isnt that enough?) ;s, i think that it is maybe even bigger than long unsigned int

edit:

ah no, long unsigned int is

18446744073709551615
xD
 
[0.3.5pl1]

item.cpp, line 1212
Code:
[B][COLOR="Red"]u[/COLOR][/B]int32_t duration = item->getDuration() / 1000;
item.h, Line 149-151
Code:
		void setDuration([B][COLOR="Red"]u[/COLOR][/B]int32_t time) {setIntAttr(ATTR_ITEM_DURATION, time);}
		void decreaseDuration([B][COLOR="Red"]u[/COLOR][/B]int32_t time) {increaseIntAttr(ATTR_ITEM_DURATION, -time);}
		[B][COLOR="Red"]u[/COLOR][/B]int32_t getDuration() const {return getIntAttr(ATTR_ITEM_DURATION);}
items.cpp, line 890:
Code:
it.decayTime = std::max(([B][COLOR="Red"]u[/COLOR][/B]int32_t)0, intValue);

edit:

ah no, long unsigned int is

18446744073709551615
xD
That's uint64_t :S
 
thats why is better to use variable data types from stdint.h, to make it standar, so is better to use the type that you gave, still dont know why would he change it ;s
 
attachment.php


:///
 

Attachments

Well, going by your logic, items can have a duration of 24.8 days.

Do you really wish to have items with THAT long of a duration?

If that's the case then wouldn't be better to just add a separate column in the player_items table, where you input the UNIX-TIME when the item was added to the player, and then have an onlogin script or something that checks if the item has "expired" and thus removes it if that's the case.
 
Well, going by your logic, items can have a duration of 24.8 days.

Do you really wish to have items with THAT long of a duration?

If that's the case then wouldn't be better to just add a separate column in the player_items table, where you input the UNIX-TIME when the item was added to the player, and then have an onlogin script or something that checks if the item has "expired" and thus removes it if that's the case.
good idea, but i want it to other purpose, must be by source editing :/
 
Status
Not open for further replies.
Back
Top