Skip to content

Commit

Permalink
v21.1.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
xAranaktu committed Apr 27, 2021
1 parent 3d68747 commit 1a05e1f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion source/FIFA21.CETRAINER
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<CheatEntries>
<CheatEntry>
<ID>0</ID>
<Description>"v21.1.1.8"</Description>
<Description>"v21.1.1.9"</Description>
<LastState Value="" RealAddress="00000000"/>
<Color>804000</Color>
<GroupHeader>1</GroupHeader>
Expand Down
4 changes: 2 additions & 2 deletions source/lua/GUI/forms/playerseditorform/manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -622,12 +622,12 @@ function thisFormManager:get_components_description()
local fnTraitCheckbox = function(addrs, comp_desc)
local field_name = comp_desc["db_field"]["field_name"]
local table_name = comp_desc["db_field"]["table_name"]
local bit = comp_desc["trait_bit"]

local addr = addrs[table_name]

local traitbitfield = self.game_db_manager:get_table_record_field_value(addr, table_name, field_name)

local is_set = bAnd(bShr(traitbitfield, comp_desc["trait_bit"]), 1)
local is_set = bAnd(bShr(traitbitfield, bit), 1)

return is_set
end
Expand Down
14 changes: 11 additions & 3 deletions source/lua/imports/GameDBManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,19 @@ function GameDBManager:get_table_record_field_value(record_addr, table_name, fie
local fld_type = fld_desc["fld_type"]

if fld_type == "DBOFIELDTYPE_INTEGER" or fld_type == "DBOFIELDTYPE_DATE" then
local v = readInteger(record_addr + fld_desc["offset"])
local v = readQword(record_addr + fld_desc["offset"])
local a = bShr(v, fld_desc["startbit"])
local b = bShl(1, fld_desc["depth"]) - 1
result = bAnd(a,b)

-- TODO: DElete
-- if fieldname == "trait1" or fieldname == "trait2" then
-- self.logger:info(string.format(
-- "fld: %s, addr: 0x%X+0x%X startbit: %d, depth: %d",
-- fieldname, record_addr, fld_desc["offset"], fld_desc["startbit"], fld_desc["depth"]
-- ))
-- end

if not raw then
result = result + fld_desc["rangelow"]
end
Expand Down Expand Up @@ -248,7 +256,7 @@ function GameDBManager:set_table_record_field_value(record_addr, table_name, fie
new_value = readInteger("magic_fldtype_real")
end

local v = readInteger(addr)
local v = readQword(addr)
--self.logger:debug(string.format("writeval: %d", v))
local startbit = fld_desc["startbit"]
local depth = fld_desc["depth"]-1
Expand Down Expand Up @@ -276,7 +284,7 @@ function GameDBManager:set_table_record_field_value(record_addr, table_name, fie
end
--self.logger:debug(string.format("writeval: %d", v))

writeInteger(addr, v)
writeQword(addr, v)
elseif fld_type == "DBOFIELDTYPE_STRING" then
local string_max_len = math.floor(fld_desc["depth"] / 8)
local new_val_len = string.len(new_value)
Expand Down

0 comments on commit 1a05e1f

Please sign in to comment.