bugfix preach related site
This commit is contained in:
parent
ce57fd472b
commit
1e8b4c9fcc
|
@ -511,7 +511,7 @@ func (obj Object) RelatedToMountain() string {
|
|||
func (obj Object) Related(relation string, regex *regexp.Regexp, init string) string {
|
||||
var list []string
|
||||
for n, f := range obj.Fields {
|
||||
if f.Type == "int" && !f.SameField(obj) && (relation == f.Related || regex.MatchString(n)) {
|
||||
if f.Type == "int" && !f.SameField(obj) && (relation == f.Related || (f.Related == "" && regex.MatchString(n))) {
|
||||
if !f.Multiple {
|
||||
list = append(list, fmt.Sprintf("x.%s == id", f.Name))
|
||||
} else {
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
"HistoricalEventMusicalFormCreated.FormId": "musicalForm",
|
||||
"HistoricalEventPoeticFormCreated.FormId": "poeticForm",
|
||||
"HistoricalEventHfReachSummit.MountainPeakId": "mountain",
|
||||
"HistoricalEventBuildingProfileAcquired.StructureId": "structure"
|
||||
"HistoricalEventBuildingProfileAcquired.StructureId": "structure",
|
||||
"HistoricalEventHfPreach.SiteHfid": "site"
|
||||
},
|
||||
"AdditionalFields": {
|
||||
"DfWorld": [
|
||||
|
|
|
@ -11375,7 +11375,7 @@ func (s HistoricalEventHfPreachTopic) MarshalJSON() ([]byte, error) {
|
|||
type HistoricalEventHfPreach struct {
|
||||
Entity1 int `json:"entity1" legend:"base" related:""` // entity_1
|
||||
Entity2 int `json:"entity2" legend:"base" related:""` // entity_2
|
||||
SiteHfid int `json:"siteHfid" legend:"base" related:""` // site_hfid
|
||||
SiteHfid int `json:"siteHfid" legend:"base" related:"site"` // site_hfid
|
||||
SpeakerHfid int `json:"speakerHfid" legend:"base" related:""` // speaker_hfid
|
||||
Topic HistoricalEventHfPreachTopic `json:"topic" legend:"base" related:""` // topic
|
||||
}
|
||||
|
@ -11392,11 +11392,9 @@ func (x *HistoricalEventHfPreach) Type() string { return "hf preach" }
|
|||
func (x *HistoricalEventHfPreach) RelatedToEntity(id int) bool {
|
||||
return x.Entity1 == id || x.Entity2 == id
|
||||
}
|
||||
func (x *HistoricalEventHfPreach) RelatedToHf(id int) bool {
|
||||
return x.SiteHfid == id || x.SpeakerHfid == id
|
||||
}
|
||||
func (x *HistoricalEventHfPreach) RelatedToHf(id int) bool { return x.SpeakerHfid == id }
|
||||
func (x *HistoricalEventHfPreach) RelatedToArtifact(id int) bool { return false }
|
||||
func (x *HistoricalEventHfPreach) RelatedToSite(id int) bool { return false }
|
||||
func (x *HistoricalEventHfPreach) RelatedToSite(id int) bool { return x.SiteHfid == id }
|
||||
func (x *HistoricalEventHfPreach) RelatedToStructure(siteId, id int) bool { return false }
|
||||
func (x *HistoricalEventHfPreach) RelatedToRegion(id int) bool { return false }
|
||||
func (x *HistoricalEventHfPreach) RelatedToWorldConstruction(id int) bool { return false }
|
||||
|
|
Loading…
Reference in New Issue