Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement suggestion in the playerdeath table #4429

Open
2 tasks done
luanluciano93 opened this issue Apr 28, 2023 · 1 comment
Open
2 tasks done

Improvement suggestion in the playerdeath table #4429

luanluciano93 opened this issue Apr 28, 2023 · 1 comment

Comments

@luanluciano93
Copy link
Contributor

Before creating an issue, please ensure:

  • This is a bug in the software that resides in this repository, and not a
    support matter (use https://otland.net/forums/support.16/ for support)
  • This issue is reproducible without changes to the C++ code in this repository

Expected behaviour

Columns "killed_by" and "mostdamage_by" cannot carry the player ID? I had problems when I used a "change name", the table stored the old names.

https://github.com/otland/forgottenserver/blob/master/schema.sql#L271-L284

@mano368
Copy link

mano368 commented Jun 26, 2023

I know its better to have as default, but here is the necessary modification.

local function getKiller(killer)
	if not killer then
		return false, "field item"
	end

	if killer:isPlayer() then
		return true, killer:getGuid()
	end

	local master = killer:getMaster()
	if master and master ~= killer and master:isPlayer() then
		return true, master:getGuid()
	end

	return false, killer:getName()
end

now you need to change your acc to get player by id too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants