ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/cfperl.xs
(Generate patch)

Comparing deliantra/server/server/cfperl.xs (file contents):
Revision 1.372 by root, Thu Apr 15 04:17:59 2010 UTC vs.
Revision 1.373 by root, Thu Apr 15 04:56:47 2010 UTC

51#include <perl.h> 51#include <perl.h>
52#include <XSUB.h> 52#include <XSUB.h>
53 53
54#include "CoroAPI.h" 54#include "CoroAPI.h"
55#include "perlxsi.c" 55#include "perlxsi.c"
56
57extern sint64 *levels; // the experience table
58 56
59typedef object_thawer &object_thawer_ref; 57typedef object_thawer &object_thawer_ref;
60typedef object_freezer &object_freezer_ref; 58typedef object_freezer &object_freezer_ref;
61 59
62typedef std::string std__string; 60typedef std::string std__string;
1799 1797
1800int random_roll (int min, int max, object *op, int goodbad); 1798int random_roll (int min, int max, object *op, int goodbad);
1801 1799
1802const_utf8_string cost_string_from_value(uint64 cost, int approx = 0) 1800const_utf8_string cost_string_from_value(uint64 cost, int approx = 0)
1803 1801
1804int
1805exp_to_level (val64 exp) 1802int exp_to_level (val64 exp)
1806 CODE:
1807{
1808 int i = 0;
1809 1803
1810 RETVAL = settings.max_level;
1811
1812 for (i = 1; i <= settings.max_level; i++)
1813 {
1814 if (levels[i] > exp)
1815 {
1816 RETVAL = i - 1;
1817 break;
1818 }
1819 }
1820}
1821 OUTPUT: RETVAL
1822
1823val64
1824level_to_min_exp (int level) 1804val64 level_to_min_exp (int level)
1825 CODE:
1826 if (level > settings.max_level)
1827 RETVAL = levels[settings.max_level];
1828 else if (level < 1)
1829 RETVAL = 0;
1830 else
1831 RETVAL = levels[level];
1832 OUTPUT: RETVAL
1833 1805
1834SV * 1806SV *
1835resistance_to_string (int atnr) 1807resistance_to_string (int atnr)
1836 CODE: 1808 CODE:
1837 if (atnr >= 0 && atnr < NROFATTACKS) 1809 if (atnr >= 0 && atnr < NROFATTACKS)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines