LunaCON: allow writing -1 to player[].newowner.

For the other player members, where formerly negative values were allowed
to be written, only -1 is now.

git-svn-id: https://svn.eduke32.com/eduke32@5192 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2015-05-16 11:56:50 +00:00
parent 1fc7e10843
commit dd2f06b869
2 changed files with 3 additions and 3 deletions

View file

@ -559,7 +559,7 @@ local PlayerLabels = {
ohoriz = PL".ohoriz", ohoriz = PL".ohoriz",
ohorizoff = PL".ohorizoff", ohorizoff = PL".ohorizoff",
newowner = { PL".newowner" }, newowner = PL".newowner",
jumping_counter = PL".jumping_counter", jumping_counter = PL".jumping_counter",
airleft = PL".airleft", airleft = PL".airleft",

View file

@ -248,7 +248,7 @@ __attribute__((packed)) struct {
int16_t pyoff, opyoff; int16_t pyoff, opyoff;
int16_t horiz, horizoff, ohoriz, ohorizoff; int16_t horiz, horizoff, ohoriz, ohorizoff;
const int16_t newowner; const<I-> int16_t newowner;
int16_t jumping_counter, airleft; int16_t jumping_counter, airleft;
int16_t fta; int16_t fta;
const<Q> int16_t ftq; const<Q> int16_t ftq;
@ -1470,7 +1470,7 @@ local player_mt = {
local allowneg = DukePlayer_prot_allowneg[key] local allowneg = DukePlayer_prot_allowneg[key]
assert(type(allowneg)=="boolean") assert(type(allowneg)=="boolean")
if (allowneg==false or not (val < 0)) then if (allowneg==false or not (val == -1)) then
DukePlayer_prot_chkfunc[key](val) DukePlayer_prot_chkfunc[key](val)
end end
ffi.cast(player_ptr_ct, p)[key] = val ffi.cast(player_ptr_ct, p)[key] = val