From 7bd608d9f589615eb7029f77ef0b322b12c04e6e Mon Sep 17 00:00:00 2001 From: Nicolas Weeger Date: Wed, 8 Mar 2006 22:51:51 +0000 Subject: [PATCH] missed a part, how did the linker not complain??? --- src/ai_python.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ai_python.cpp b/src/ai_python.cpp index d387174ff23..ceac445bc1c 100644 --- a/src/ai_python.cpp +++ b/src/ai_python.cpp @@ -743,6 +743,18 @@ static PyObject* wrapper_team_gold(wesnoth_team* team, void* /*closure*/) return Py_BuildValue("i", team->team_->gold()); } +static PyObject* wrapper_team_side(wesnoth_team* team, void* /*closure*/) +{ + int side = 0; + for (size_t t = 0; t < running_instance->get_teams().size(); t++) { + if (team->team_ == &running_instance->get_teams()[t]) { + side = 1 + t; + break; + } + } + return Py_BuildValue("i", side); +} + static int wrapper_team_internal_compare(wesnoth_team* left, wesnoth_team* right) { return (long)left->team_ - (long)right->team_;