forked from github/server
neue lua-exporte:
- int get_plane_id(string) unit.number setzt auch auf 0 (killen)
This commit is contained in:
parent
5f0ba5c2a0
commit
a53cc0a25c
|
@ -5,6 +5,7 @@
|
|||
// kernel includes
|
||||
#include <gamecode/laws.h>
|
||||
#include <kernel/race.h>
|
||||
#include <kernel/plane.h>
|
||||
#include <kernel/item.h>
|
||||
#include <kernel/reports.h>
|
||||
#include <kernel/save.h>
|
||||
|
@ -63,6 +64,13 @@ write_reports()
|
|||
|
||||
extern int process_orders(void);
|
||||
|
||||
static int
|
||||
find_plane_id(const char * name)
|
||||
{
|
||||
plane * pl = getplanebyname(name);
|
||||
return pl?pl->id:0;
|
||||
}
|
||||
|
||||
void
|
||||
bind_eressea(lua_State * L)
|
||||
{
|
||||
|
@ -76,6 +84,9 @@ bind_eressea(lua_State * L)
|
|||
def("read_orders", &readorders),
|
||||
def("process_orders", &process_orders),
|
||||
def("add_equipment", &lua_addequipment),
|
||||
def("get_turn", &get_turn)
|
||||
def("get_turn", &get_turn),
|
||||
|
||||
/* planes not really implemented */
|
||||
def("find_plane_id", &find_plane_id)
|
||||
];
|
||||
}
|
||||
|
|
|
@ -61,6 +61,8 @@ unit_setnumber(unit& u, int number)
|
|||
if (u.number==0) {
|
||||
set_number(&u, number);
|
||||
u.hp = unit_max_hp(&u) * number;
|
||||
} else {
|
||||
scale_number(&u, number);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue