Skip to content

Commit

Permalink
spam prevention
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaFire15 committed Jun 30, 2024
1 parent fd62229 commit bf0e916
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion code/datums/achievements/_achievement_data.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
/datum/achievement_data/proc/increase_score(datum/award/score/achievement_type, mob/user, value)
var/datum/award/score/A = SSachievements.awards[achievement_type]
get_data(achievement_type) //Get the current status first if necessary
if(length(A.high_scores) == 0 || A.high_scores[A.high_scores[1]] < value)
if(A.announce_highscore && (length(A.high_scores) == 0 || A.high_scores[A.high_scores[1]] < value)) //NSV13 - Adds support for non-spamming scores.
to_chat(world, "<span class='greenannounce'><B>[user.client.key] set a new high score in [A.name]: [value]</B></span>")
if(!data[achievement_type] || value > data[achievement_type])
data[achievement_type] = value
Expand Down
2 changes: 2 additions & 0 deletions code/datums/achievements/_awards.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@
default_value = 0
var/track_high_scores = TRUE
var/list/high_scores = list()
///Determines whether we announce if we achieve a new highscore.
var/announce_highscore = TRUE //NSV13 - no spammies

/datum/award/score/New()
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion nsv13/code/datums/achievements/nsv_achievements.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@
name = "Torpedo Technician"
desc = "Better get to making those torps!"
database_id = TORPCOUNT_SCORE

announce_highscore = FALSE //Please do not spam the chat if some muni tech is cooking.

0 comments on commit bf0e916

Please sign in to comment.