Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Conversation

@Altoids1
Copy link
Contributor

@Altoids1 Altoids1 commented Mar 5, 2020

image

This adds four more achievements, as part of #7657, of the Cargonian variety.

Coder Warning

For some reason, #7751 made both read and write of the database entries for achievements no longer work.

I have... no real idea why, but I've decided to revert Alexkar's changes and do the sanitation through new methods.

All achievements now use the initial() variants of their properties to prevent tampering.

In addition, all ckeys used in queries are run through ckey(), which would remove any and all special characters that're necessary to do a SQL injection.

Doing it this way should not only be more performative (using native BYOND procs instead of several sequential calls to bsql.dll) but also actually work.

Changelog

🆑 Altoids
rscadd: Cargo now has a couple achievements of their own!
bugfix: Fixed bug that caused achievements to not load nor save.
/:cl:

@Altoids1 Altoids1 requested a review from AsV9 as a code owner March 5, 2020 00:06
@yogstation13-bot yogstation13-bot added the Feature This adds new content to the game label Mar 5, 2020
@Altoids1 Altoids1 added the WORK IN PROGRESS This PR will take a while before its complete, but is actively being worked on. label Mar 5, 2020
@boodaliboo
Copy link
Contributor

Assistant

@Altoids1 Altoids1 changed the title Achievement Get Part 3 - Cargo Achievements Achievement Get Part 3 - Cargo Achievements (and Achievement bugfixes!) Mar 5, 2020
@Altoids1 Altoids1 changed the title Achievement Get Part 3 - Cargo Achievements (and Achievement bugfixes!) Achievement Get Part 3 - Cargo Achievements (and bugfixes!) Mar 6, 2020
@Altoids1 Altoids1 removed the WORK IN PROGRESS This PR will take a while before its complete, but is actively being worked on. label Mar 7, 2020
@Altoids1
Copy link
Contributor Author

Altoids1 commented Mar 9, 2020

Ready for review.

if(M.real_name == account_holder)
SSachievements.unlock_achievement(/datum/achievement/cargo/bourgeois, M.client)
is_bourgeois = TRUE
break
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't assume there aren't going to be any duplicated names due to genetic fuckery or something like that

Suggested change
break

Comment on lines 49 to 51
message_admins("[ADMIN_LOOKUPFLW(usr)] has launched an artillery strike.")
if(usr.client)
SSachievements.unlock_achievement(/datum/achievement/cargo/bsa, usr.client)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an admin only version, not the cargo not

Suggested change
message_admins("[ADMIN_LOOKUPFLW(usr)] has launched an artillery strike.")
if(usr.client)
SSachievements.unlock_achievement(/datum/achievement/cargo/bsa, usr.client)
message_admins("[ADMIN_LOOKUPFLW(usr)] has launched an artillery strike.")

for(var/x in GLOB.player_list)
var/mob/M = x
if(M.real_name == account_holder)
SSachievements.unlock_achievement(/datum/achievement/cargo/bourgeois, M.client)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a check within the unlock_achievement proc to check if the client exists, its too easy to forget a if(whatever.client)

@alexkar598 alexkar598 merged commit a36e679 into yogstation13:master Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Feature This adds new content to the game

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants