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

Factions Housekeeping #3815

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update
MarkSuckerberg committed Jan 28, 2025
commit 64949aed492fbad85010f09352ae25f2b0f48587
4 changes: 2 additions & 2 deletions code/modules/cargo/console.dm
Original file line number Diff line number Diff line change
@@ -180,7 +180,7 @@
var/datum/overmap/outpost/current_outpost = current_ship.docked_to
if(istype(current_ship.docked_to))
var/datum/supply_pack/current_pack = locate(params["ref"]) in current_outpost.supply_packs
var/same_faction = current_pack.faction ? current_pack.faction.allowed_faction(current_ship.faction_datum) : FALSE
var/same_faction = current_pack.faction ? current_pack.faction.allowed_faction(current_ship.faction) : FALSE
var/total_cost = (same_faction && current_pack.faction_discount) ? current_pack.cost - (current_pack.cost * (current_pack.faction_discount * 0.01)) : current_pack.cost
if(!current_pack || !charge_account?.has_money(total_cost))
return
@@ -290,7 +290,7 @@
)
if((current_pack.hidden))
continue
var/same_faction = current_pack.faction ? current_pack.faction.allowed_faction(current_ship.faction_datum) : FALSE
var/same_faction = current_pack.faction ? current_pack.faction.allowed_faction(current_ship.faction) : FALSE
var/discountedcost = (same_faction && current_pack.faction_discount) ? current_pack.cost - (current_pack.cost * (current_pack.faction_discount * 0.01)) : null
if(current_pack.faction_locked && !same_faction)
continue
3 changes: 3 additions & 0 deletions code/modules/faction/faction_datum.dm
Original file line number Diff line number Diff line change
@@ -16,6 +16,9 @@
if(!short_name)
short_name = uppertext(copytext_char(name, 3))

var/list/all_allowed = list(src.type, )
allowed_factions = typecacheof(allowed_factions)

/// Easy way to check if something is "allowed", checks to see if it matches the name or faction typepath because factions are a fucking mess
/datum/faction/proc/allowed_faction(value_to_check)
///Are we the same datum?