uox3/source/power.h
Xoduz 37a76083de Rest of the changes for 0.99.6-RC1
Misc cleanup and standardization of style and naming conventions in code and scripts
Added missing code for showing race in paperdoll based on ini setting
Players can no longer use Polymorph spell while incognitoed, or while under effect of tribal paint
Players can no longer use Incognito spell while polymorphed, or while under the effects of tribal paint
Facial hair is now removed from players who are under the effects of Incognito spell that changes their gender for female
2022-10-24 18:39:33 +08:00

26 lines
711 B
C++

#ifndef __POWER_H__
#define __POWER_H__
#include <cstdint>
//o------------------------------------------------------------------------------------------------o
//| Function - power()
//o------------------------------------------------------------------------------------------------o
//| Purpose - Integer based version of the pow() function
//o------------------------------------------------------------------------------------------------o
inline std::uint32_t power( std::uint32_t base, std::uint32_t exponent )
{
if( exponent == 0 )
return 1;
if( exponent > 0 )
{
auto total = base;
for( std::uint32_t i = 1; i < exponent; ++i )
{
total *= base;
}
return total;
}
return 0;
}
#endif